diff options
author | George Karpenkov <ekarpenkov@apple.com> | 2018-02-02 02:19:43 +0000 |
---|---|---|
committer | George Karpenkov <ekarpenkov@apple.com> | 2018-02-02 02:19:43 +0000 |
commit | fb4acffbd11a213addb32ab13658a5ab36567486 (patch) | |
tree | c4bc0dc4d6895cbd72bdd4a1be239b9f404a0bb2 /clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp | |
parent | 572f6cecf1c835c71f8df0c2e7fbe44b0f11953a (diff) | |
download | bcm5719-llvm-fb4acffbd11a213addb32ab13658a5ab36567486.tar.gz bcm5719-llvm-fb4acffbd11a213addb32ab13658a5ab36567486.zip |
[analyzer] Expose return statement from CallExit program point
If the return statement is stored, we might as well allow querying
against it.
Also fix the bug where the return statement is not stored
if there is no return value.
This change un-merges two ExplodedNodes during call exit when the state
is otherwise identical - the CallExitBegin node itself and the "Bind
Return Value"-tagged node.
And expose the return statement through
getStatement helper function.
Differential Revision: https://reviews.llvm.org/D42130
llvm-svn: 324052
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp')
-rw-r--r-- | clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp index e2a35c04266..dc9dd5bd06d 100644 --- a/clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp +++ b/clang/lib/StaticAnalyzer/Checkers/AnalysisOrderChecker.cpp @@ -37,7 +37,9 @@ class AnalysisOrderChecker check::PostCall, check::NewAllocator, check::Bind, - check::RegionChanges> { + check::RegionChanges, + check::LiveSymbols> { + bool isCallbackEnabled(AnalyzerOptions &Opts, StringRef CallbackName) const { return Opts.getBooleanOption("*", false, this) || Opts.getBooleanOption(CallbackName, false, this); @@ -118,6 +120,11 @@ public: llvm::errs() << "Bind\n"; } + void checkLiveSymbols(ProgramStateRef State, SymbolReaper &SymReaper) const { + if (isCallbackEnabled(State, "LiveSymbols")) + llvm::errs() << "LiveSymbols\n"; + } + ProgramStateRef checkRegionChanges(ProgramStateRef State, const InvalidatedSymbols *Invalidated, |