summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
diff options
context:
space:
mode:
authorJordan Rose <jordan_rose@apple.com>2012-07-26 20:04:00 +0000
committerJordan Rose <jordan_rose@apple.com>2012-07-26 20:04:00 +0000
commitc5d852447b7cfbdc4ca189dbb42972e43dfaade4 (patch)
tree242ccff259a6654a89deaaeeb1f7192fe3801088 /clang/lib/StaticAnalyzer
parent443ec10e2db0fdc3b32d3f0bada0ecc2baaa49a0 (diff)
downloadbcm5719-llvm-c5d852447b7cfbdc4ca189dbb42972e43dfaade4.tar.gz
bcm5719-llvm-c5d852447b7cfbdc4ca189dbb42972e43dfaade4.zip
[analyzer] Inline ctors + dtors when the CFG is built for them.
At the very least this means initializer nodes for constructors and automatic object destructors are present in the CFG. llvm-svn: 160803
Diffstat (limited to 'clang/lib/StaticAnalyzer')
-rw-r--r--clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
index 62c288dad4b..4431c03d497 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
@@ -286,10 +286,15 @@ bool ExprEngine::inlineCall(const CallEvent &Call,
// These are always at least possible to inline.
break;
case CE_CXXConstructor:
- case CE_CXXDestructor:
- // Do not inline constructors until we can really model destructors.
- // This is unfortunate, but basically necessary for smart pointers and such.
- return false;
+ case CE_CXXDestructor: {
+ // Only inline constructors and destructors if we built the CFGs for them
+ // properly.
+ const AnalysisDeclContext *ADC = CallerSFC->getAnalysisDeclContext();
+ if (!ADC->getCFGBuildOptions().AddImplicitDtors ||
+ !ADC->getCFGBuildOptions().AddInitializers)
+ return false;
+ break;
+ }
case CE_CXXAllocator:
// Do not inline allocators until we model deallocators.
// This is unfortunate, but basically necessary for smart pointers and such.
OpenPOWER on IntegriCloud