summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-10-18 04:08:49 +0000
committerTed Kremenek <kremenek@apple.com>2008-10-18 04:08:49 +0000
commit8f5dc295ceb26f788f4b832b20e6ec2d2e87d032 (patch)
tree948ecf177f42312dc95d998bd2dabd879af7789d
parente86755e14f4ba98ea241f81b743114a8b2333ba9 (diff)
downloadbcm5719-llvm-8f5dc295ceb26f788f4b832b20e6ec2d2e87d032.tar.gz
bcm5719-llvm-8f5dc295ceb26f788f4b832b20e6ec2d2e87d032.zip
Function calls and ObjC message expressions can be used in a lvalue context if they return a structure. E.g foo().x == 1. We don't really support, however, such temporaries yet in the environment or the store.
llvm-svn: 57760
-rw-r--r--clang/lib/Analysis/GRExprEngine.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/clang/lib/Analysis/GRExprEngine.cpp b/clang/lib/Analysis/GRExprEngine.cpp
index ee7141782f9..103ec145d4e 100644
--- a/clang/lib/Analysis/GRExprEngine.cpp
+++ b/clang/lib/Analysis/GRExprEngine.cpp
@@ -445,7 +445,18 @@ void GRExprEngine::VisitLValue(Expr* Ex, NodeTy* Pred, NodeSet& Dst) {
// Note that we have a similar problem for bitfields, since they don't
// have "locations" in the sense that we can take their address.
Dst.Add(Pred);
- return;
+ return;
+
+ case Stmt::CallExprClass:
+ case Stmt::ObjCMessageExprClass:
+ // Function calls and message expressions that return temporaries
+ // that are objects can be called in this context. We need to
+ // enhance our support of struct return values, so right now just
+ // do a regular visit.
+ assert (!Ex->getType()->isIntegerType());
+ assert (!Ex->getType()->isPointerType());
+ Visit(Ex, Pred, Dst);
+
}
}
OpenPOWER on IntegriCloud