diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-07-30 23:36:40 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-07-30 23:36:40 +0000 |
commit | 9d702ae1cd5cfa19d884cbef77e1df99395138bb (patch) | |
tree | b84176d0d4001323cf52441f3a6689e526917ac4 /include/clang | |
parent | c7ff8e19081c2e974f05f66c4fa9b40750fc655f (diff) |
Canonicalization of dependent C++0x decltype types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/ASTContext.h | 2 | ||||
-rw-r--r-- | include/clang/AST/Type.h | 17 |
2 files changed, 19 insertions, 0 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index a8ed08e387..a1f190a74b 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -76,12 +76,14 @@ class ASTContext { llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes; llvm::FoldingSet<FunctionProtoType> FunctionProtoTypes; llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes; + llvm::FoldingSet<DependentDecltypeType> DependentDecltypeTypes; llvm::FoldingSet<TemplateTypeParmType> TemplateTypeParmTypes; llvm::FoldingSet<TemplateSpecializationType> TemplateSpecializationTypes; llvm::FoldingSet<QualifiedNameType> QualifiedNameTypes; llvm::FoldingSet<TypenameType> TypenameTypes; llvm::FoldingSet<ObjCInterfaceType> ObjCInterfaceTypes; llvm::FoldingSet<ObjCObjectPointerType> ObjCObjectPointerTypes; + llvm::FoldingSet<QualifiedTemplateName> QualifiedTemplateNames; llvm::FoldingSet<DependentTemplateName> DependentTemplateNames; diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index 3072c67556..6eaa4e67a7 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -1636,6 +1636,7 @@ class DecltypeType : public Type { // from it. QualType UnderlyingType; +protected: DecltypeType(Expr *E, QualType underlyingType, QualType can = QualType()); friend class ASTContext; // ASTContext creates these. public: @@ -1649,6 +1650,22 @@ public: static bool classof(const DecltypeType *) { return true; } }; +/// Subclass of DecltypeType that is used for canonical, dependent +/// C++0x decltype types. +class DependentDecltypeType : public DecltypeType, public llvm::FoldingSetNode { + ASTContext &Context; + +public: + DependentDecltypeType(ASTContext &Context, Expr *E); + + void Profile(llvm::FoldingSetNodeID &ID) { + Profile(ID, Context, getUnderlyingExpr()); + } + + static void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context, + Expr *E); +}; + 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 |