summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/CFRefCount.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-12-22 22:13:46 +0000
committerTed Kremenek <kremenek@apple.com>2009-12-22 22:13:46 +0000
commite19711d223fcc927b938cfa5e3fd26a1d9493611 (patch)
tree31215533d5c4b1f28d3e6a6f12fb4bf05328f93a /clang/lib/Analysis/CFRefCount.cpp
parent42fe663e3b0e416b1c92eca1379451c076d22eb1 (diff)
downloadbcm5719-llvm-e19711d223fcc927b938cfa5e3fd26a1d9493611.tar.gz
bcm5719-llvm-e19711d223fcc927b938cfa5e3fd26a1d9493611.zip
Add transfer functions support for visiting an Objective-C message expression as an lvalue when the return type is a C++ reference.
llvm-svn: 91926
Diffstat (limited to 'clang/lib/Analysis/CFRefCount.cpp')
-rw-r--r--clang/lib/Analysis/CFRefCount.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp
index fb253a3c8ff..a15a8f16c46 100644
--- a/clang/lib/Analysis/CFRefCount.cpp
+++ b/clang/lib/Analysis/CFRefCount.cpp
@@ -2945,12 +2945,13 @@ void CFRefCount::EvalSummary(ExplodedNodeSet& Dst,
// For CallExpr, use the result type to know if it returns a reference.
if (const CallExpr *CE = dyn_cast<CallExpr>(Ex)) {
const Expr *Callee = CE->getCallee();
- SVal L = state->getSVal(Callee);
-
- const FunctionDecl *FD = L.getAsFunctionDecl();
- if (FD)
+ if (const FunctionDecl *FD = state->getSVal(Callee).getAsFunctionDecl())
T = FD->getResultType();
}
+ else if (const ObjCMessageExpr *ME = dyn_cast<ObjCMessageExpr>(Ex)) {
+ if (const ObjCMethodDecl *MD = ME->getMethodDecl())
+ T = MD->getResultType();
+ }
if (Loc::IsLocType(T) || (T->isIntegerType() && T->isScalarType())) {
unsigned Count = Builder.getCurrentBlockCount();
OpenPOWER on IntegriCloud