mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user