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 | 594827281cbcd40a07637fdc7678bacccce30e0e (patch) | |
| tree | d360c46ce7a54f63463b841ba19c3fe999b19989 /clang/lib/CodeGen | |
| parent | ca61b6567bab5b1d3e7210969d55e15d1177f5de (diff) | |
| download | bcm5719-llvm-594827281cbcd40a07637fdc7678bacccce30e0e.tar.gz bcm5719-llvm-594827281cbcd40a07637fdc7678bacccce30e0e.zip | |
Silly special case: never load when dereferencing void*.
llvm-svn: 120905
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index 8ed8cb38db2..a65eae8f78a 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/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(); |

