diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-19 14:40:25 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-19 14:40:25 +0000 |
commit | 0f45682b463773896c9e40ee1ed2b3e4ade1561e (patch) | |
tree | 8a82d2c920ce39ae306a6c245d534b95c0290eb9 /lib/Serialization/ASTWriterDecl.cpp | |
parent | 735ceaa4ccb60df5993245e645f7127bf4a4325f (diff) |
Combine common (de-)serialization logic for typedefs and type aliases
into operations on TypedefNameDecl. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r-- | lib/Serialization/ASTWriterDecl.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 26dfd36f77..4e9a315d22 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -55,6 +55,7 @@ namespace clang { void VisitUsingDirectiveDecl(UsingDirectiveDecl *D); void VisitNamespaceAliasDecl(NamespaceAliasDecl *D); void VisitTypeDecl(TypeDecl *D); + void VisitTypedefNameDecl(TypedefNameDecl *D); void VisitTypedefDecl(TypedefDecl *D); void VisitTypeAliasDecl(TypeAliasDecl *D); void VisitUnresolvedUsingTypenameDecl(UnresolvedUsingTypenameDecl *D); @@ -200,11 +201,14 @@ void ASTDeclWriter::VisitTypeDecl(TypeDecl *D) { Writer.AddTypeRef(QualType(D->getTypeForDecl(), 0), Record); } -void ASTDeclWriter::VisitTypedefDecl(TypedefDecl *D) { +void ASTDeclWriter::VisitTypedefNameDecl(TypedefNameDecl *D) { VisitRedeclarable(D); VisitTypeDecl(D); - Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record); + Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record); +} +void ASTDeclWriter::VisitTypedefDecl(TypedefDecl *D) { + VisitTypedefNameDecl(D); if (!D->hasAttrs() && !D->isImplicit() && !D->isUsed(false) && @@ -221,9 +225,7 @@ void ASTDeclWriter::VisitTypedefDecl(TypedefDecl *D) { } void ASTDeclWriter::VisitTypeAliasDecl(TypeAliasDecl *D) { - VisitRedeclarable(D); - VisitTypeDecl(D); - Writer.AddTypeSourceInfo(D->getTypeSourceInfo(), Record); + VisitTypedefNameDecl(D); Code = serialization::DECL_TYPEALIAS; } |