summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis
diff options
context:
space:
mode:
authorZhongxing Xu <xuzhongxing@gmail.com>2010-10-01 02:47:11 +0000
committerZhongxing Xu <xuzhongxing@gmail.com>2010-10-01 02:47:11 +0000
commitea360a3b1af5ff19a9e3eb7dfcca59bae690566f (patch)
treec9fa4d76ee2d894d74c8a7b4f45d457c2059832e /clang/lib/Analysis
parentf51de67640d7bda3f5e054bba3fccd7d8c4c9615 (diff)
downloadbcm5719-llvm-ea360a3b1af5ff19a9e3eb7dfcca59bae690566f.tar.gz
bcm5719-llvm-ea360a3b1af5ff19a9e3eb7dfcca59bae690566f.zip
The old logic would add non-struct and non C++ struct variables to the local
scope. Now we only add C++ struct with non-trivial destructor variables to the local scope. llvm-svn: 115269
Diffstat (limited to 'clang/lib/Analysis')
-rw-r--r--clang/lib/Analysis/CFG.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/clang/lib/Analysis/CFG.cpp b/clang/lib/Analysis/CFG.cpp
index a60c3a6b01c..4cf0264003b 100644
--- a/clang/lib/Analysis/CFG.cpp
+++ b/clang/lib/Analysis/CFG.cpp
@@ -566,13 +566,12 @@ LocalScope* CFGBuilder::addLocalScopeForVarDecl(VarDecl* VD,
// Check if type is a C++ class with non-trivial destructor.
if (const RecordType* RT = QT.getTypePtr()->getAs<RecordType>())
if (const CXXRecordDecl* CD = dyn_cast<CXXRecordDecl>(RT->getDecl()))
- if (CD->hasTrivialDestructor())
- return Scope;
-
- // Add the variable to scope
- Scope = createOrReuseLocalScope(Scope);
- Scope->addVar(VD);
- ScopePos = Scope->begin();
+ if (!CD->hasTrivialDestructor()) {
+ // Add the variable to scope
+ Scope = createOrReuseLocalScope(Scope);
+ Scope->addVar(VD);
+ ScopePos = Scope->begin();
+ }
return Scope;
}
OpenPOWER on IntegriCloud