]> granicus.if.org Git - clang/commitdiff
Add a dump function to Stmt that takes only an output stream. No functionality change.
authorFaisal Vali <faisalv@yahoo.com>
Sun, 22 Mar 2015 13:35:56 +0000 (13:35 +0000)
committerFaisal Vali <faisalv@yahoo.com>
Sun, 22 Mar 2015 13:35:56 +0000 (13:35 +0000)
This allows dumping to any given output stream but without requiring a SourceManager, similar to the interface provided by Decl.

It's useful when writing certain generic debug functions, external to the clang code base (for e.g.).

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

include/clang/AST/Stmt.h
lib/AST/ASTDumper.cpp

index 465bceaa19305c4f3d906b996ab560df5b111053..33f4aa0dcd270493830084d7b0b67f5df62e3017 100644 (file)
@@ -374,6 +374,7 @@ public:
   void dump() const;
   void dump(SourceManager &SM) const;
   void dump(raw_ostream &OS, SourceManager &SM) const;
+  void dump(raw_ostream &OS) const;
 
   /// dumpColor - same as dump(), but forces color highlighting.
   void dumpColor() const;
index a5ad6db379792b8eb4f4e4ee5bca65ea4f67e538..711c3292760b7ba65c6f9de3125297845f91c3a2 100644 (file)
@@ -2294,6 +2294,11 @@ LLVM_DUMP_METHOD void Stmt::dump(raw_ostream &OS, SourceManager &SM) const {
   P.dumpStmt(this);
 }
 
+LLVM_DUMP_METHOD void Stmt::dump(raw_ostream &OS) const {
+  ASTDumper P(OS, nullptr, nullptr);
+  P.dumpStmt(this);
+}
+
 LLVM_DUMP_METHOD void Stmt::dump() const {
   ASTDumper P(llvm::errs(), nullptr, nullptr);
   P.dumpStmt(this);