diff options
author | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-10-05 08:38:06 +0000 |
---|---|---|
committer | Zhongxing Xu <xuzhongxing@gmail.com> | 2010-10-05 08:38:06 +0000 |
commit | 4e493e0dbac2aaac04c041f3d7dee9eccfb97689 (patch) | |
tree | e77bbd0360cac825ae6c20738e852c6008178a8f | |
parent | 7c625d8ffc20b92fff9e1690cd2484fcb6498183 (diff) |
* Simplify code
* Fix dump() to make it consistent with the test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115609 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Analysis/CFG.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Analysis/CFG.cpp b/lib/Analysis/CFG.cpp index 53479bc058..e44f0fc90b 100644 --- a/lib/Analysis/CFG.cpp +++ b/lib/Analysis/CFG.cpp @@ -642,14 +642,14 @@ 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()) { - // Add the variable to scope - Scope = createOrReuseLocalScope(Scope); - Scope->addVar(VD); - ScopePos = Scope->begin(); - } + + if (const CXXRecordDecl* CD = QT->getAsCXXRecordDecl()) + if (!CD->hasTrivialDestructor()) { + // Add the variable to scope + Scope = createOrReuseLocalScope(Scope); + Scope->addVar(VD); + ScopePos = Scope->begin(); + } return Scope; } @@ -2715,13 +2715,13 @@ static void print_elem(llvm::raw_ostream &OS, StmtPrinterHelper* Helper, } else if (CFGBaseDtor BE = E.getAs<CFGBaseDtor>()) { const CXXBaseSpecifier *BS = BE.getBaseSpecifier(); OS << "~" << BS->getType()->getAsCXXRecordDecl()->getName() << "()"; - OS << " (Base destructor)\n"; + OS << " (Base object destructor)\n"; } else if (CFGMemberDtor ME = E.getAs<CFGMemberDtor>()) { FieldDecl *FD = ME.getFieldDecl(); OS << "this->" << FD->getName(); OS << ".~" << FD->getType()->getAsCXXRecordDecl()->getName() << "()"; - OS << " (Member destructor)\n"; + OS << " (Member object destructor)\n"; } } |