summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-12-04 12:43:24 +0000
committerJohn McCall <rjmccall@apple.com>2010-12-04 12:43:24 +0000
commit594827281cbcd40a07637fdc7678bacccce30e0e (patch)
treed360c46ce7a54f63463b841ba19c3fe999b19989 /clang/lib/CodeGen
parentca61b6567bab5b1d3e7210969d55e15d1177f5de (diff)
downloadbcm5719-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.cpp6
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();
OpenPOWER on IntegriCloud