diff options
author | John McCall <rjmccall@apple.com> | 2010-12-04 12:43:24 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-12-04 12:43:24 +0000 |
commit | fd569004b78124c1041feee75a1e311166268c8d (patch) | |
tree | ea1522d2b59bc9cfcd8ac79aebf0bc8fe072cdd5 /lib/CodeGen/CGExprScalar.cpp | |
parent | 85515d64c15838eadb3ffe82b635f8217b04be8a (diff) |
Silly special case: never load when dereferencing void*.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120905 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 8ed8cb38db..a65eae8f78 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -312,7 +312,11 @@ public: // value as the "address". return EmitLValue(E->getSubExpr()).getAddress(); } - Value *VisitUnaryDeref(const Expr *E) { return EmitLoadOfLValue(E); } + Value *VisitUnaryDeref(const UnaryOperator *E) { + if (E->getType()->isVoidType()) + return Visit(E->getSubExpr()); // the actual value should be unused + return EmitLoadOfLValue(E); + } Value *VisitUnaryPlus(const UnaryOperator *E) { // This differs from gcc, though, most likely due to a bug in gcc. TestAndClearIgnoreResultAssign(); |