diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-03 19:13:25 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-03 19:13:25 +0000 |
commit | a83f7ed3de1ce98d633dfb6bb223bb7711893dce (patch) | |
tree | 56b9d4114a632063e53cbdc7ea1187a75b03b967 /lib/Sema/SemaDeclCXX.cpp | |
parent | 32d335e63bd287e5c9297532171284cdf4c7888c (diff) |
Minor renaming/refactoring. No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77985 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index eedbdcefc6..974dfcc071 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -2371,14 +2371,14 @@ void Sema::InitializeVarWithConstructor(VarDecl *VD, VD->setInit(Context, Temp); } -void Sema::MarkDestructorReferenced(SourceLocation Loc, QualType DeclInitType) +void Sema::FinalizeVarWithDestructor(VarDecl *VD, QualType DeclInitType) { CXXRecordDecl *ClassDecl = cast<CXXRecordDecl>( DeclInitType->getAs<RecordType>()->getDecl()); if (!ClassDecl->hasTrivialDestructor()) if (CXXDestructorDecl *Destructor = const_cast<CXXDestructorDecl*>(ClassDecl->getDestructor(Context))) - MarkDeclarationReferenced(Loc, Destructor); + MarkDeclarationReferenced(VD->getLocation(), Destructor); } /// AddCXXDirectInitializerToDecl - This action is called immediately after @@ -2447,9 +2447,7 @@ void Sema::AddCXXDirectInitializerToDecl(DeclPtrTy Dcl, VDecl->setCXXDirectInitializer(true); InitializeVarWithConstructor(VDecl, Constructor, DeclInitType, (Expr**)Exprs.release(), NumExprs); - // FIXME. Must do all that is needed to destroy the object - // on scope exit. For now, just mark the destructor as used. - MarkDestructorReferenced(VDecl->getLocation(), DeclInitType); + FinalizeVarWithDestructor(VDecl, DeclInitType); } return; } |