diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-07-26 20:04:13 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-07-26 20:04:13 +0000 |
commit | 888c90ac0ef6baf7d47e86cf5cc4715707d223b1 (patch) | |
tree | cd103a2e63d98b39b1b8c75a04a516cd1fd9efc3 /lib/StaticAnalyzer/Core/PathDiagnostic.cpp | |
parent | d7f1d134a03ace51f8d142fbb7f436330704ede5 (diff) |
[analyzer] Handle base class initializers and destructors.
Most of the logic here is fairly simple; the interesting thing is that
we now distinguish complete constructors from base or delegate constructors.
We also make sure to cast to the base class before evaluating a constructor
or destructor, since non-virtual base classes may behave differently.
This includes some refactoring of VisitCXXConstructExpr and VisitCXXDestructor
in order to keep ExprEngine.cpp as clean as possible (leaving the details for
ExprEngineCXX.cpp).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160806 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/StaticAnalyzer/Core/PathDiagnostic.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Core/PathDiagnostic.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp index 5496df0f8f..3306eaa7f8 100644 --- a/lib/StaticAnalyzer/Core/PathDiagnostic.cpp +++ b/lib/StaticAnalyzer/Core/PathDiagnostic.cpp @@ -532,7 +532,12 @@ getLocationForCaller(const StackFrameContext *SFC, SM, CallerCtx); } case CFGElement::BaseDtor: - case CFGElement::MemberDtor: + case CFGElement::MemberDtor: { + const AnalysisDeclContext *CallerInfo = CallerCtx->getAnalysisDeclContext(); + if (const Stmt *CallerBody = CallerInfo->getBody()) + return PathDiagnosticLocation::createEnd(CallerBody, SM, CallerCtx); + return PathDiagnosticLocation::create(CallerInfo->getDecl(), SM); + } case CFGElement::TemporaryDtor: llvm_unreachable("not yet implemented!"); } |