[ASTPrinter] Print expressions

Add new `-print-ast-decl` frontend option for only printing declarations,
to match existing behavior.
Some tests want to print the AST, but don't care about expressions.

The existing `-print-ast` option now prints function bodies and expressions.
Not all expressions are printed yet, but most common ones are.
This commit is contained in:
Louis D'hauwe
2021-12-22 11:35:31 -08:00
parent 77f4dfa926
commit a89ea380a9
17 changed files with 695 additions and 30 deletions

View File

@@ -932,7 +932,7 @@ int swift::doGenerateModuleAPIDescription(StringRef MainExecutablePath,
}
CI.performSema();
PrintOptions Options = PrintOptions::printEverything();
PrintOptions Options = PrintOptions::printDeclarations();
ModuleDecl *M = CI.getMainModule();
M->getMainSourceFile().print(llvm::outs(), Options);