diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-12-22 22:13:46 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-12-22 22:13:46 +0000 |
commit | e19711d223fcc927b938cfa5e3fd26a1d9493611 (patch) | |
tree | 31215533d5c4b1f28d3e6a6f12fb4bf05328f93a /clang/lib/Analysis/CFRefCount.cpp | |
parent | 42fe663e3b0e416b1c92eca1379451c076d22eb1 (diff) | |
download | bcm5719-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.cpp | 9 |
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(); |