summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclPrinter.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-30 06:31:56 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-30 06:31:56 +0000
commit3bc6e4c72aa91604812b1a387b435a84c0489d4f (patch)
tree8641951f48bea9eafb12c5b12e125b0a4a666953 /clang/lib/AST/DeclPrinter.cpp
parent2d042f1cf42297dbd9cf7ae9ef558a74dfc0be9e (diff)
downloadbcm5719-llvm-3bc6e4c72aa91604812b1a387b435a84c0489d4f.tar.gz
bcm5719-llvm-3bc6e4c72aa91604812b1a387b435a84c0489d4f.zip
Printing for using directives, e.g.,
using namespace std::debug; Extended UsingDirectiveDecl to store the nested-name-specifier that precedes the nominated namespace. llvm-svn: 72614
Diffstat (limited to 'clang/lib/AST/DeclPrinter.cpp')
-rw-r--r--clang/lib/AST/DeclPrinter.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 6412f750ae9..bfd3dca3e6d 100644
--- a/clang/lib/AST/DeclPrinter.cpp
+++ b/clang/lib/AST/DeclPrinter.cpp
@@ -51,12 +51,15 @@ namespace {
void VisitFieldDecl(FieldDecl *D);
void VisitVarDecl(VarDecl *D);
void VisitParmVarDecl(ParmVarDecl *D);
+ void VisitOriginalParmVarDecl(OriginalParmVarDecl *D);
void VisitFileScopeAsmDecl(FileScopeAsmDecl *D);
+ void VisitOverloadedFunctionDecl(OverloadedFunctionDecl *D);
+ void VisitUsingDirectiveDecl(UsingDirectiveDecl *D);
void VisitNamespaceDecl(NamespaceDecl *D);
void VisitLinkageSpecDecl(LinkageSpecDecl *D);
void VisitTemplateDecl(TemplateDecl *D);
- void VisitObjCClassDecl(ObjCClassDecl *D);
void VisitObjCMethodDecl(ObjCMethodDecl *D);
+ void VisitObjCClassDecl(ObjCClassDecl *D);
void VisitObjCImplementationDecl(ObjCImplementationDecl *D);
void VisitObjCInterfaceDecl(ObjCInterfaceDecl *D);
void VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D);
@@ -402,6 +405,10 @@ void DeclPrinter::VisitParmVarDecl(ParmVarDecl *D) {
VisitVarDecl(D);
}
+void DeclPrinter::VisitOriginalParmVarDecl(OriginalParmVarDecl *D) {
+ VisitVarDecl(D);
+}
+
void DeclPrinter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) {
Out << "__asm (";
D->getAsmString()->printPretty(Out, Context, 0, Policy, Indentation);
@@ -411,6 +418,18 @@ void DeclPrinter::VisitFileScopeAsmDecl(FileScopeAsmDecl *D) {
//----------------------------------------------------------------------------
// C++ declarations
//----------------------------------------------------------------------------
+void DeclPrinter::VisitOverloadedFunctionDecl(OverloadedFunctionDecl *D) {
+ assert(false &&
+ "OverloadedFunctionDecls aren't really decls and are never printed");
+}
+
+void DeclPrinter::VisitUsingDirectiveDecl(UsingDirectiveDecl *D) {
+ Out << "using namespace ";
+ if (D->getQualifier())
+ D->getQualifier()->print(Out, Policy);
+ Out << D->getNominatedNamespace()->getNameAsString();
+}
+
void DeclPrinter::VisitNamespaceDecl(NamespaceDecl *D) {
Out << "namespace " << D->getNameAsString() << " {\n";
VisitDeclContext(D);
OpenPOWER on IntegriCloud