aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-07-10 22:07:52 +0000
committerJordan Rose <jordan_rose@apple.com>2012-07-10 22:07:52 +0000
commit852aa0d2c5d2d1faf2d77b5aa3c0848068a342c5 (patch)
tree479d6107f7b9d49e36af6eecacef6f06004202b2 /lib/StaticAnalyzer/Core/PathDiagnostic.cpp
parent8d276d38c258dfc572586daf6c0e8f8fce249c0e (diff)
[analyzer] Make CallEnter, CallExitBegin, and CallExitEnd not be StmtPoints
These ProgramPoints are used in inlining calls, and not all calls have associated statements anymore. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160021 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/PathDiagnostic.cpp')
-rw-r--r--lib/StaticAnalyzer/Core/PathDiagnostic.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
index a1e662f129..bfb8bf6432 100644
--- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
+++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp
@@ -339,6 +339,9 @@ PathDiagnosticLocation
else if (const PostStmt *PS = dyn_cast<PostStmt>(&P)) {
S = PS->getStmt();
}
+ else if (const CallExitEnd *CEE = dyn_cast<CallExitEnd>(&P)) {
+ S = CEE->getCalleeContext()->getCallSite();
+ }
return PathDiagnosticLocation(S, SMng, P.getLocationContext());
}
@@ -501,6 +504,10 @@ static PathDiagnosticLocation getLastStmtLoc(const ExplodedNode *N,
ProgramPoint PP = N->getLocation();
if (const StmtPoint *SP = dyn_cast<StmtPoint>(&PP))
return PathDiagnosticLocation(SP->getStmt(), SM, PP.getLocationContext());
+ // FIXME: Handle implicit calls.
+ if (const CallExitEnd *CEE = dyn_cast<CallExitEnd>(&PP))
+ if (const Stmt *CallSite = CEE->getCalleeContext()->getCallSite())
+ return PathDiagnosticLocation(CallSite, SM, PP.getLocationContext());
if (N->pred_empty())
break;
N = *N->pred_begin();
@@ -670,7 +677,8 @@ std::string StackHintGeneratorForSymbol::getMessage(const ExplodedNode *N){
const CallExitEnd *CExit = dyn_cast<CallExitEnd>(&P);
assert(CExit && "Stack Hints should be constructed at CallExitEnd points.");
- const CallExpr *CE = dyn_cast_or_null<CallExpr>(CExit->getStmt());
+ const Stmt *CallSite = CExit->getCalleeContext()->getCallSite();
+ const CallExpr *CE = dyn_cast_or_null<CallExpr>(CallSite);
if (!CE)
return "";