summaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-01-24 04:29:31 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-01-24 04:29:31 +0000
commita9bb955b499c244d24d02311f0f9100ade506794 (patch)
tree6fc3e5859a0cf850e707731dc70da2d61baa5620 /lib/Analysis
parent25f4c19fba097e8fa3b6884dbdd1b3571cd72741 (diff)
More fixes/tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/CFG.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp
index c760d49899..c7040fc6d4 100644
--- a/lib/Analysis/CFG.cpp
+++ b/lib/Analysis/CFG.cpp
@@ -721,7 +721,7 @@ void CFGBuilder::addAutomaticObjDtors(LocalScope::const_iterator B,
}
const CXXDestructorDecl *Dtor = Ty->getAsCXXRecordDecl()->getDestructor();
- if (cast<FunctionType>(Dtor->getType())->getNoReturnAttr())
+ if (Dtor && cast<FunctionType>(Dtor->getType())->getNoReturnAttr())
Block = createNoReturnBlock();
else
autoCreateBlock();
@@ -864,7 +864,7 @@ LocalScope* CFGBuilder::addLocalScopeForVarDecl(VarDecl *VD,
// Check if type is a C++ class with non-trivial destructor.
if (const CXXRecordDecl *CD = QT->getAsCXXRecordDecl())
- if (!CD->hasTrivialDestructor()) {
+ if (CD->hasDefinition() && !CD->hasTrivialDestructor()) {
// Add the variable to scope
Scope = createOrReuseLocalScope(Scope);
Scope->addVar(VD);