[PATCH] D60910: [WIP] Dumping the AST to JSON

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 25 10:03:21 PDT 2019

aaron.ballman marked 3 inline comments as done.
aaron.ballman added inline comments.

Comment at: include/clang/AST/JSONNodeDumper.h:73
+      Indentation.clear();
+      OS << "\n" << Indentation << "}\n";
+      TopLevel = true;
hintonda wrote:
> Just curious, since you clear Indentation on the previous line, do you need it here?
Definitely not required -- I had it there for consistency with other streaming output, but it's spurious. I'll remove.

Comment at: include/clang/Frontend/FrontendOptions.h:311
+  /// Specifies the output format of the AST.
+  enum ASTOutputFormat {
+    AOF_Default,
hintonda wrote:
> Why can't you use the enum defined in `clang/AST/ASTDumperUtils.h`?  Seems to make the `dump()` call below unnecessarily ugly.
I thought there would be a layering violation if AST and Frontend colluded on that, but I see now that Frontend already links against AST, so perhaps there isn't a layering violation after all?

I'll investigate to see if this can be cleaned up.



More information about the cfe-commits mailing list