diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-02 18:27:05 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-02 18:27:05 +0000 |
commit | ed48a8faa10b6750f334540711c7b3949bbfb3ae (patch) | |
tree | 0e136a1fee2a73b7ea52d7f45569ec98b5fef500 /include/clang/AST/Type.h | |
parent | e04f5fc25cf49e8a5b836459d836c20dc3229a95 (diff) |
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
Diffstat (limited to 'include/clang/AST/Type.h')
-rw-r--r-- | include/clang/AST/Type.h | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index a49c83cf1d..f1e7dfe3e9 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -2267,14 +2267,9 @@ public: }; class TagType : public Type { - /// Stores the TagDecl associated with this type. The decl will - /// point to the TagDecl that actually defines the entity (or is a - /// definition in progress), if there is such a definition. The - /// single-bit value will be non-zero when this tag is in the - /// process of being defined. - mutable llvm::PointerIntPair<TagDecl *, 1> decl; - friend class ASTContext; - friend class TagDecl; + /// Stores the TagDecl associated with this type. The decl may point to any + /// TagDecl that declares the entity. + TagDecl * decl; protected: TagType(TypeClass TC, const TagDecl *D, QualType can); @@ -2282,12 +2277,11 @@ protected: virtual Linkage getLinkageImpl() const; public: - TagDecl *getDecl() const { return decl.getPointer(); } + TagDecl *getDecl() const; /// @brief Determines whether this type is in the process of being /// defined. - bool isBeingDefined() const { return decl.getInt(); } - void setBeingDefined(bool Def) const { decl.setInt(Def? 1 : 0); } + bool isBeingDefined() const; static bool classof(const Type *T) { return T->getTypeClass() >= TagFirst && T->getTypeClass() <= TagLast; @@ -2580,7 +2574,6 @@ class InjectedClassNameType : public Type { QualType InjectedType; friend class ASTContext; // ASTContext creates these. - friend class TagDecl; // TagDecl mutilates the Decl friend class PCHReader; // FIXME: ASTContext::getInjectedClassNameType is not // currently suitable for PCH reading, too much // interdependencies. @@ -2598,7 +2591,7 @@ public: return cast<TemplateSpecializationType>(InjectedType.getTypePtr()); } - CXXRecordDecl *getDecl() const { return Decl; } + CXXRecordDecl *getDecl() const; bool isSugared() const { return false; } QualType desugar() const { return QualType(this, 0); } |