From ed48a8faa10b6750f334540711c7b3949bbfb3ae Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Mon, 2 Aug 2010 18:27:05 +0000 Subject: Remove mutable data on TagType and InjectedClassNameType, by instead walking the declaration chain in search of a definition. This is necessary for a sane chained PCH implementation. No observable performance change on Carbon.h syntax-only, and bootstraps cleanly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110051 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Decl.cpp | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'lib/AST/Decl.cpp') diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index a30a430382..0e0bbf34a1 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -1534,14 +1534,7 @@ void TagDecl::setTypedefForAnonDecl(TypedefDecl *TDD) { } void TagDecl::startDefinition() { - if (TagType *TagT = const_cast(TypeForDecl->getAs())) { - TagT->decl.setPointer(this); - TagT->decl.setInt(1); - } else if (InjectedClassNameType *Injected - = const_cast( - TypeForDecl->getAs())) { - Injected->Decl = cast(this); - } + IsBeingDefined = true; if (isa(this)) { CXXRecordDecl *D = cast(this); @@ -1558,17 +1551,7 @@ void TagDecl::completeDefinition() { "definition completed but not started"); IsDefinition = true; - if (TagType *TagT = const_cast(TypeForDecl->getAs())) { - assert(TagT->decl.getPointer() == this && - "Attempt to redefine a tag definition?"); - TagT->decl.setInt(0); - } else if (InjectedClassNameType *Injected - = const_cast( - TypeForDecl->getAs())) { - assert(Injected->Decl == this && - "Attempt to redefine a class template definition?"); - (void)Injected; - } + IsBeingDefined = false; } TagDecl* TagDecl::getDefinition() const { -- cgit v1.2.3-70-g09d2