[PATCH] D45096: Allow the creation of human-friendly ASTDumper to arbitrary output stream

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 6 04:15:17 PDT 2018


alexfh added a comment.

Another couple of nits.



================
Comment at: docs/HowToSetupToolingForLLVM.rst:136
       if (this->ASTDump.operator _Bool())
-          return clang::CreateASTDumper(this->ASTDumpFilter);
+          return clang::CreateASTDumper(nullptr, this->ASTDumpFilter);
       if (this->ASTPrint.operator _Bool())
----------------
Please add an argument comment for nullptr, e.g.

  return clang::CreateASTDumper(/*OS=*/nullptr, ...);

or maybe

  return clang::CreateASTDumper(nullptr /*dump to stderr*/, ...);

Same in the actual callers below.


================
Comment at: include/clang/Frontend/ASTConsumers.h:38
+// AST dumper: dumps the raw AST in human-readable form to the given output
+// stream.
+std::unique_ptr<ASTConsumer> CreateASTDumper(std::unique_ptr<raw_ostream> OS,
----------------
Add "When OS is nullptr, dumps AST to stderr."


Repository:
  rC Clang

https://reviews.llvm.org/D45096





More information about the cfe-commits mailing list