From b6b8f9e2915c1c9dd91ddb100fc2f11d4d22881f Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 29 Jul 2009 23:36:44 +0000 Subject: Make tag declarations redeclarable. This change has three purposes: 1) Allow the Index library (and any other interested client) to walk the set of declarations for a given tag (enum, union, class, whatever). At the moment, this information is not readily available. 2) Reduce our dependence on TagDecl::TypeForDecl being mapped down to a TagType (for which getDecl() will return the tag definition, if one exists). This property won't exist for class template partial specializations. 3) Make the canonical declaration of a TagDecl actually canonical, e.g., so that it does not change when the tag is defined. llvm-svn: 77523 --- clang/lib/Frontend/PCHReaderDecl.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Frontend/PCHReaderDecl.cpp') diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp index 99a1a16835a..65da7dc4517 100644 --- a/clang/lib/Frontend/PCHReaderDecl.cpp +++ b/clang/lib/Frontend/PCHReaderDecl.cpp @@ -112,6 +112,8 @@ void PCHDeclReader::VisitTypedefDecl(TypedefDecl *TD) { void PCHDeclReader::VisitTagDecl(TagDecl *TD) { VisitTypeDecl(TD); + TD->setPreviousDeclaration( + cast_or_null(Reader.GetDecl(Record[Idx++]))); TD->setTagKind((TagDecl::TagKind)Record[Idx++]); TD->setDefinition(Record[Idx++]); TD->setTypedefForAnonDecl( -- cgit v1.2.3