diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-07-30 23:18:24 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-07-30 23:18:24 +0000 |
commit | b197572cf1cd70a817a1f546478cb2cb9112c48e (patch) | |
tree | 478c5a2caa30004f0c3662d9f9f5c4d43be3d4ab /include/clang | |
parent | 03e205031b08669f05c41eed5b896fc94c4a12bb (diff) |
Canonicalization for dependent typeof(expr) types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77639 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 | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 529477f315..a8ed08e387 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -75,13 +75,13 @@ class ASTContext { llvm::FoldingSet<VectorType> VectorTypes; llvm::FoldingSet<FunctionNoProtoType> FunctionNoProtoTypes; llvm::FoldingSet<FunctionProtoType> FunctionProtoTypes; + llvm::FoldingSet<DependentTypeOfExprType> DependentTypeOfExprTypes; 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 76a5a3f404..3072c67556 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -1577,6 +1577,8 @@ public: /// TypeOfExprType (GCC extension). class TypeOfExprType : public Type { Expr *TOExpr; + +protected: TypeOfExprType(Expr *E, QualType can = QualType()); friend class ASTContext; // ASTContext creates these. public: @@ -1589,6 +1591,24 @@ public: static bool classof(const TypeOfExprType *) { return true; } }; +/// Subclass of TypeOfExprType that is used for canonical, dependent +/// typeof(expr) types. +class DependentTypeOfExprType + : public TypeOfExprType, public llvm::FoldingSetNode { + ASTContext &Context; + +public: + DependentTypeOfExprType(ASTContext &Context, Expr *E) + : TypeOfExprType(E), Context(Context) { } + + void Profile(llvm::FoldingSetNodeID &ID) { + Profile(ID, Context, getUnderlyingExpr()); + } + + static void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context, + Expr *E); +}; + /// TypeOfType (GCC extension). class TypeOfType : public Type { QualType TOType; |