diff options
author | John McCall <rjmccall@apple.com> | 2009-10-24 08:00:42 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-10-24 08:00:42 +0000 |
commit | ba6a9bd384df475780be636ca45bcef5c5bbd19f (patch) | |
tree | 5a424cd2045611749ab24e8da7d7d872f3f9d5f8 /include | |
parent | 3eefb1c4bd2c562e43f25e0dba657bb32361dd14 (diff) |
Preserve type source information in TypedefDecls. Preserve it across
template instantiation. Preserve it through PCH. Show it off to the indexer.
I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84994 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/AST/Decl.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h index cd4535d70c..214febecf2 100644 --- a/include/clang/AST/Decl.h +++ b/include/clang/AST/Decl.h @@ -1311,20 +1311,29 @@ public: class TypedefDecl : public TypeDecl { /// UnderlyingType - This is the type the typedef is set to. - QualType UnderlyingType; + DeclaratorInfo *DInfo; + TypedefDecl(DeclContext *DC, SourceLocation L, - IdentifierInfo *Id, QualType T) - : TypeDecl(Typedef, DC, L, Id), UnderlyingType(T) {} + IdentifierInfo *Id, DeclaratorInfo *DInfo) + : TypeDecl(Typedef, DC, L, Id), DInfo(DInfo) {} virtual ~TypedefDecl() {} public: static TypedefDecl *Create(ASTContext &C, DeclContext *DC, - SourceLocation L,IdentifierInfo *Id, - QualType T); + SourceLocation L, IdentifierInfo *Id, + DeclaratorInfo *DInfo); + + DeclaratorInfo *getTypeDeclaratorInfo() const { + return DInfo; + } - QualType getUnderlyingType() const { return UnderlyingType; } - void setUnderlyingType(QualType newType) { UnderlyingType = newType; } + QualType getUnderlyingType() const { + return DInfo->getType(); + } + void setTypeDeclaratorInfo(DeclaratorInfo *newType) { + DInfo = newType; + } // Implement isa/cast/dyncast/etc. static bool classof(const Decl *D) { return D->getKind() == Typedef; } |