]> granicus.if.org Git - clang/commitdiff
Added a clause to the ASTImporter allowing it to
authorSean Callanan <scallanan@apple.com>
Thu, 17 Nov 2011 23:20:56 +0000 (23:20 +0000)
committerSean Callanan <scallanan@apple.com>
Thu, 17 Nov 2011 23:20:56 +0000 (23:20 +0000)
import TranslationUnitDecls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144934 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTImporter.cpp

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