From: Faisal Vali Date: Sun, 22 Mar 2015 13:35:56 +0000 (+0000) Subject: Add a dump function to Stmt that takes only an output stream. No functionality change. X-Git-Tag: llvmorg-3.7.0-rc1~8638 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2da8ed92416cbd5dc3f9b55738660b17d5872981;p=platform%2Fupstream%2Fllvm.git Add a dump function to Stmt that takes only an output stream. No functionality change. 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.). llvm-svn: 232912 --- diff --git a/clang/include/clang/AST/Stmt.h b/clang/include/clang/AST/Stmt.h index 465bcea..33f4aa0 100644 --- a/clang/include/clang/AST/Stmt.h +++ b/clang/include/clang/AST/Stmt.h @@ -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; diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp index a5ad6db..711c329 100644 --- a/clang/lib/AST/ASTDumper.cpp +++ b/clang/lib/AST/ASTDumper.cpp @@ -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);