diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-09-28 00:00:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-09-28 00:00:00 +0000 |
commit | e10288c1e9e06dbd715f47bfaa22ce5d65fdf096 (patch) | |
tree | a068c72c1b8ae315d41f87a9b75b04e0ef95eec1 /lib/Sema/SemaDecl.cpp | |
parent | 4a74df5901330c577d0a30d052338d06bbf9e279 (diff) |
Centralize the management of CXXRecordDecl::DefinitionData's
HasTrivialConstructor, HasTrivialCopyConstructor,
HasTrivialCopyAssignment, and HasTrivialDestructor bits in
CXXRecordDecl's methods. This completes all but the Abstract bit and
the set of conversion functions, both of which will require a bit of
extra work. The majority of <rdar://problem/8459981> is now
implemented (but not all of it).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114929 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index e6e4420f23..c189bce8eb 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -3425,8 +3425,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, << FixItHint::CreateRemoval(D.getDeclSpec().getVirtualSpecLoc()); } else { // Okay: Add virtual to the method. - CXXRecordDecl *CurClass = cast<CXXRecordDecl>(DC); - CurClass->setMethodAsVirtual(NewFD); + NewFD->setVirtualAsWritten(true); } } @@ -3927,11 +3926,6 @@ void Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, return NewFD->setInvalidDecl(); } } - - // C++ [class.dtor]p3: A destructor is trivial if it is an implicitly- - // declared destructor. - // FIXME: C++0x: don't do this for "= default" destructors - Record->setHasTrivialDestructor(false); } else if (CXXConversionDecl *Conversion = dyn_cast<CXXConversionDecl>(NewFD)) { ActOnConversionDeclarator(Conversion); @@ -6185,23 +6179,9 @@ FieldDecl *Sema::CheckFieldDecl(DeclarationName Name, QualType T, } if (!InvalidDecl && getLangOptions().CPlusPlus) { - CXXRecordDecl* CXXRecord = cast<CXXRecordDecl>(Record); - - if (T->isReferenceType()) - CXXRecord->setHasTrivialConstructor(false); - if (const RecordType *RT = EltTy->getAs<RecordType>()) { CXXRecordDecl* RDecl = cast<CXXRecordDecl>(RT->getDecl()); if (RDecl->getDefinition()) { - if (!RDecl->hasTrivialConstructor()) - CXXRecord->setHasTrivialConstructor(false); - if (!RDecl->hasTrivialCopyConstructor()) - CXXRecord->setHasTrivialCopyConstructor(false); - if (!RDecl->hasTrivialCopyAssignment()) - CXXRecord->setHasTrivialCopyAssignment(false); - if (!RDecl->hasTrivialDestructor()) - CXXRecord->setHasTrivialDestructor(false); - // C++ 9.5p1: An object of a class with a non-trivial // constructor, a non-trivial copy constructor, a non-trivial // destructor, or a non-trivial copy assignment operator |