diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-12-02 23:23:56 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-12-02 23:23:56 +0000 |
commit | ba34552e79aaf7ac5db21a7b6e9c00aab75f4732 (patch) | |
tree | 73d479ee4d1220393f08cd83e51bb3d97f872004 /clang/lib/AST/DeclPrinter.cpp | |
parent | 45ccba64ab34275cf272df01ae838524b94f5e2b (diff) | |
download | bcm5719-llvm-ba34552e79aaf7ac5db21a7b6e9c00aab75f4732.tar.gz bcm5719-llvm-ba34552e79aaf7ac5db21a7b6e9c00aab75f4732.zip |
Introduce a module import declaration, so that we properly represent, e.g.,
__import_module__ std.vector;
in the AST.
llvm-svn: 145725
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r-- | clang/lib/AST/DeclPrinter.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index e5b4b0431b1..91b011fbda6 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -19,6 +19,7 @@ #include "clang/AST/Expr.h" #include "clang/AST/ExprCXX.h" #include "clang/AST/PrettyPrinter.h" +#include "clang/Basic/Module.h" #include "llvm/Support/raw_ostream.h" using namespace clang; @@ -58,6 +59,7 @@ namespace { void VisitLabelDecl(LabelDecl *D); void VisitParmVarDecl(ParmVarDecl *D); void VisitFileScopeAsmDecl(FileScopeAsmDecl *D); + void VisitImportDecl(ImportDecl *D); void VisitStaticAssertDecl(StaticAssertDecl *D); void VisitNamespaceDecl(NamespaceDecl *D); void VisitUsingDirectiveDecl(UsingDirectiveDecl *D); @@ -646,6 +648,11 @@ void DeclPrinter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) { Out << ")"; } +void DeclPrinter::VisitImportDecl(ImportDecl *D) { + Out << "__import_module__ " << D->getImportedModule()->getFullModuleName() + << ";\n"; +} + void DeclPrinter::VisitStaticAssertDecl(StaticAssertDecl *D) { Out << "static_assert("; D->getAssertExpr()->printPretty(Out, Context, 0, Policy, Indentation); |