[cfe-commits] [PATCH] Add -ast-dump-depth option

Philip Craig philipjcraig at gmail.com
Sat Nov 3 20:54:14 PDT 2012


Hi doug.gregor,

StmtDumper has some incomplete support for limiting the maximum dump depth. This patch completes that support, and exposes it as an -ast-dump-depth option.

By completing the max depth support, this patch changes the behavior of Stmt::dump() to limit the depth to 4 by default. I don't know whether current users of dump() want this change or not. The behavior of Stmt::dumpAll() is unchanged, as is the default behavior of -ast-dump.

I originally thought this option would be useful for testing Decl dumping, but now I'm not finding many places where it helps much. So alternatively, I could submit a patch that removes the incomplete support in StmtDumper.

http://llvm-reviews.chandlerc.com/D98

Files:
  test/Misc/ast-dump-stmt.c
  test/Misc/ast-dump-stmt.m
  include/clang/AST/DeclBase.h
  include/clang/AST/PrettyPrinter.h
  include/clang/AST/Stmt.h
  include/clang/Driver/CC1Options.td
  include/clang/Frontend/ASTConsumers.h
  include/clang/Frontend/FrontendOptions.h
  lib/AST/DeclPrinter.cpp
  lib/AST/DumpXML.cpp
  lib/AST/StmtDumper.cpp
  lib/AST/StmtPrinter.cpp
  lib/Frontend/ASTConsumers.cpp
  lib/Frontend/CompilerInvocation.cpp
  lib/Frontend/FrontendActions.cpp
  test/Tooling/clang-check-ast-dump.cpp
  tools/clang-check/ClangCheck.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98.1.patch
Type: text/x-patch
Size: 18107 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121103/d0ee5a11/attachment.bin>


More information about the cfe-commits mailing list