]> granicus.if.org Git - clang/commitdiff
Revert the dump functions to send output to llvm::errs(), matching the LLVM conventio...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 9 Aug 2010 10:54:31 +0000 (10:54 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 9 Aug 2010 10:54:31 +0000 (10:54 +0000)
'-ast-print' / '-ast-dump' command line options still send output to llvm::outs().

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

include/clang/AST/Stmt.h
lib/AST/StmtDumper.cpp
lib/AST/StmtPrinter.cpp

index ec3dac4bc371f8eccbe30aad6e767b3f3749162c..62a6b6463df5aa93d33abb6540e6a3cebe8d42ed 100644 (file)
@@ -203,6 +203,7 @@ public:
   /// This is useful in a debugger.
   void dump() const;
   void dump(SourceManager &SM) const;
+  void dump(llvm::raw_ostream &OS, SourceManager &SM) const;
 
   /// dumpAll - This does a dump of the specified AST fragment and all subtrees.
   void dumpAll() const;
index cfd659cecbcc0c67f7622fe1897e0583fafdd6f9..4b7c8f0b40f5a4acf57b533379ea7d793a118fed 100644 (file)
@@ -633,30 +633,34 @@ void StmtDumper::VisitObjCSuperExpr(ObjCSuperExpr *Node) {
 /// specified node and a few nodes underneath it, but not the whole subtree.
 /// This is useful in a debugger.
 void Stmt::dump(SourceManager &SM) const {
-  StmtDumper P(&SM, llvm::outs(), 4);
+  dump(llvm::errs(), SM);
+}
+
+void Stmt::dump(llvm::raw_ostream &OS, SourceManager &SM) const {
+  StmtDumper P(&SM, OS, 4);
   P.DumpSubTree(const_cast<Stmt*>(this));
-  llvm::outs() << "\n";
+  OS << "\n";
 }
 
 /// dump - This does a local dump of the specified AST fragment.  It dumps the
 /// specified node and a few nodes underneath it, but not the whole subtree.
 /// This is useful in a debugger.
 void Stmt::dump() const {
-  StmtDumper P(0, llvm::outs(), 4);
+  StmtDumper P(0, llvm::errs(), 4);
   P.DumpSubTree(const_cast<Stmt*>(this));
-  llvm::outs() << "\n";
+  llvm::errs() << "\n";
 }
 
 /// dumpAll - This does a dump of the specified AST fragment and all subtrees.
 void Stmt::dumpAll(SourceManager &SM) const {
-  StmtDumper P(&SM, llvm::outs(), ~0U);
+  StmtDumper P(&SM, llvm::errs(), ~0U);
   P.DumpSubTree(const_cast<Stmt*>(this));
-  llvm::outs() << "\n";
+  llvm::errs() << "\n";
 }
 
 /// dumpAll - This does a dump of the specified AST fragment and all subtrees.
 void Stmt::dumpAll() const {
-  StmtDumper P(0, llvm::outs(), ~0U);
+  StmtDumper P(0, llvm::errs(), ~0U);
   P.DumpSubTree(const_cast<Stmt*>(this));
-  llvm::outs() << "\n";
+  llvm::errs() << "\n";
 }
index 293e24065ad4821ad5c289acb21f7430129c6496..41b1415f717943d865c754c7bb3ee8918d14e49a 100644 (file)
@@ -1354,7 +1354,7 @@ void StmtPrinter::VisitBlockDeclRefExpr(BlockDeclRefExpr *Node) {
 //===----------------------------------------------------------------------===//
 
 void Stmt::dumpPretty(ASTContext& Context) const {
-  printPretty(llvm::outs(), Context, 0,
+  printPretty(llvm::errs(), Context, 0,
               PrintingPolicy(Context.getLangOptions()));
 }
 
@@ -1368,7 +1368,7 @@ void Stmt::printPretty(llvm::raw_ostream &OS, ASTContext& Context,
   }
 
   if (Policy.Dump && &Context) {
-    dump(Context.getSourceManager());
+    dump(OS, Context.getSourceManager());
     return;
   }