I’ve been looking at the code in ASTDumper.cpp and noticed that most of it basically uses one of three approaches:
- Some of it uses the ASTDumper’s own classes, like PrintExpr and PrintStmt
- Some of it uses an external ASTPrinter class that implements some printing logic used in other parts of the compiler
- And some of it just prints directly to the output stream, with (seemingly) no centralized logic
While I imagine this is just the result of several unrelated changes throughout the compiler’s development, I wanted to ask, is there a specific motivation behind these decisions? And is there a plan (or a desire, perhaps) to eventually simplify and unify these approaches?