Added a clause to the ASTImporter allowing it to

import TranslationUnitDecls.

llvm-svn: 144934
This commit is contained in:
Sean Callanan 2011-11-17 23:20:56 +00:00
parent 65e2211b95
commit 651982790a
1 changed files with 10 additions and 0 deletions

View File

@ -100,6 +100,7 @@ namespace clang {
bool IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToRecord); bool IsStructuralMatch(EnumDecl *FromEnum, EnumDecl *ToRecord);
bool IsStructuralMatch(ClassTemplateDecl *From, ClassTemplateDecl *To); bool IsStructuralMatch(ClassTemplateDecl *From, ClassTemplateDecl *To);
Decl *VisitDecl(Decl *D); Decl *VisitDecl(Decl *D);
Decl *VisitTranslationUnitDecl(TranslationUnitDecl *D);
Decl *VisitNamespaceDecl(NamespaceDecl *D); Decl *VisitNamespaceDecl(NamespaceDecl *D);
Decl *VisitTypedefNameDecl(TypedefNameDecl *D, bool IsAlias); Decl *VisitTypedefNameDecl(TypedefNameDecl *D, bool IsAlias);
Decl *VisitTypedefDecl(TypedefDecl *D); Decl *VisitTypedefDecl(TypedefDecl *D);
@ -2030,6 +2031,15 @@ Decl *ASTNodeImporter::VisitDecl(Decl *D) {
return 0; return 0;
} }
Decl *ASTNodeImporter::VisitTranslationUnitDecl(TranslationUnitDecl *D) {
TranslationUnitDecl *ToD =
Importer.getToContext().getTranslationUnitDecl();
Importer.Imported(D, ToD);
return ToD;
}
Decl *ASTNodeImporter::VisitNamespaceDecl(NamespaceDecl *D) { Decl *ASTNodeImporter::VisitNamespaceDecl(NamespaceDecl *D) {
// Import the major distinguishing characteristics of this namespace. // Import the major distinguishing characteristics of this namespace.
DeclContext *DC, *LexicalDC; DeclContext *DC, *LexicalDC;