forked from OSchip/llvm-project
Added a clause to the ASTImporter allowing it to
import TranslationUnitDecls. llvm-svn: 144934
This commit is contained in:
parent
65e2211b95
commit
651982790a
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue