]> granicus.if.org Git - clang/commitdiff
Improve support for using decls in the decl printer.
authorAnders Carlsson <andersca@mac.com>
Fri, 28 Aug 2009 19:16:39 +0000 (19:16 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 28 Aug 2009 19:16:39 +0000 (19:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80386 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclPrinter.cpp

index 69144735c9721892f5c4186e951a39e7025305f7..1dea2238bc31d6b224aeca7d12865652b2a63500 100644 (file)
@@ -70,6 +70,8 @@ namespace {
     void VisitObjCCompatibleAliasDecl(ObjCCompatibleAliasDecl *D);
     void VisitObjCPropertyDecl(ObjCPropertyDecl *D);
     void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);
+    void VisitUnresolvedUsingDecl(UnresolvedUsingDecl *D);
+    void VisitUsingDecl(UsingDecl *D);
   };
 }
 
@@ -836,3 +838,17 @@ void DeclPrinter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *PID) {
   if (PID->getPropertyIvarDecl())
     Out << "=" << PID->getPropertyIvarDecl()->getNameAsString();
 }
+
+void DeclPrinter::VisitUsingDecl(UsingDecl *D) {
+  Out << "using ";
+  D->getTargetNestedNameDecl()->print(Out, Policy);
+  Out << D->getTargetDecl()->getNameAsString();
+}
+
+void DeclPrinter::VisitUnresolvedUsingDecl(UnresolvedUsingDecl *D) {
+  Out << "using ";
+  D->getTargetNestedNameSpecifier()->print(Out, Policy);
+  Out << D->getTargetName().getAsString();
+}
+
+