@@ -464,20 +464,21 @@ getPrimaryOrMainSourceFile(const CompilerInstance &Instance) {
464
464
465
465
// / Dumps the AST of all available primary source files. If corresponding output
466
466
// / files were specified, use them; otherwise, dump the AST to stdout.
467
- static bool dumpAST (CompilerInstance &Instance) {
467
+ static bool dumpAST (CompilerInstance &Instance,
468
+ ASTDumpMemberLoading memberLoading) {
468
469
const FrontendOptions &opts = Instance.getInvocation ().getFrontendOptions ();
469
470
auto dumpAST = [&](SourceFile *SF, raw_ostream &out) {
470
471
switch (opts.DumpASTFormat ) {
471
472
case FrontendOptions::ASTFormat::Default:
472
- SF->dump (out, ASTDumpMemberLoading::Parsed );
473
+ SF->dump (out, memberLoading );
473
474
break ;
474
475
case FrontendOptions::ASTFormat::JSON:
475
- SF->dumpJSON (out);
476
+ SF->dumpJSON (out, memberLoading );
476
477
break ;
477
478
case FrontendOptions::ASTFormat::JSONZlib:
478
479
std::string jsonText;
479
480
llvm::raw_string_ostream jsonTextStream (jsonText);
480
- SF->dumpJSON (jsonTextStream);
481
+ SF->dumpJSON (jsonTextStream, memberLoading );
481
482
482
483
SmallVector<uint8_t , 0 > compressed;
483
484
llvm::compression::zlib::compress (llvm::arrayRefFromStringRef (jsonText),
@@ -1233,12 +1234,14 @@ static bool performAction(CompilerInstance &Instance,
1233
1234
1234
1235
// MARK: Actions that Dump
1235
1236
case FrontendOptions::ActionType::DumpParse:
1236
- return dumpAST (Instance);
1237
+ return dumpAST (Instance, ASTDumpMemberLoading::Parsed );
1237
1238
case FrontendOptions::ActionType::DumpAST:
1238
1239
return withSemanticAnalysis (
1239
- Instance, observer, [](CompilerInstance &Instance) {
1240
- return dumpAST (Instance);
1241
- }, /* runDespiteErrors=*/ true );
1240
+ Instance, observer,
1241
+ [](CompilerInstance &Instance) {
1242
+ return dumpAST (Instance, ASTDumpMemberLoading::TypeChecked);
1243
+ },
1244
+ /* runDespiteErrors=*/ true );
1242
1245
case FrontendOptions::ActionType::PrintAST:
1243
1246
return withSemanticAnalysis (
1244
1247
Instance, observer, [](CompilerInstance &Instance) {
0 commit comments