[cfe-commits] r57760 - /cfe/trunk/lib/Analysis/GRExprEngine.cpp
Ted Kremenek
kremenek at apple.com
Fri Oct 17 21:08:49 PDT 2008
Author: kremenek
Date: Fri Oct 17 23:08:49 2008
New Revision: 57760
URL: http://llvm.org/viewvc/llvm-project?rev=57760&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Analysis/GRExprEngine.cpp
Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=57760&r1=57759&r2=57760&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Fri Oct 17 23:08:49 2008
@@ -445,7 +445,18 @@
// 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);
+
}
}
More information about the cfe-commits
mailing list