@@ -464,20 +464,21 @@ getPrimaryOrMainSourceFile(const CompilerInstance &Instance) {
464464
465465// / Dumps the AST of all available primary source files. If corresponding output
466466// / 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) {
468469 const FrontendOptions &opts = Instance.getInvocation ().getFrontendOptions ();
469470 auto dumpAST = [&](SourceFile *SF, raw_ostream &out) {
470471 switch (opts.DumpASTFormat ) {
471472 case FrontendOptions::ASTFormat::Default:
472- SF->dump (out, ASTDumpMemberLoading::Parsed );
473+ SF->dump (out, memberLoading );
473474 break ;
474475 case FrontendOptions::ASTFormat::JSON:
475- SF->dumpJSON (out);
476+ SF->dumpJSON (out, memberLoading );
476477 break ;
477478 case FrontendOptions::ASTFormat::JSONZlib:
478479 std::string jsonText;
479480 llvm::raw_string_ostream jsonTextStream (jsonText);
480- SF->dumpJSON (jsonTextStream);
481+ SF->dumpJSON (jsonTextStream, memberLoading );
481482
482483 SmallVector<uint8_t , 0 > compressed;
483484 llvm::compression::zlib::compress (llvm::arrayRefFromStringRef (jsonText),
@@ -1233,12 +1234,14 @@ static bool performAction(CompilerInstance &Instance,
12331234
12341235 // MARK: Actions that Dump
12351236 case FrontendOptions::ActionType::DumpParse:
1236- return dumpAST (Instance);
1237+ return dumpAST (Instance, ASTDumpMemberLoading::Parsed );
12371238 case FrontendOptions::ActionType::DumpAST:
12381239 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 );
12421245 case FrontendOptions::ActionType::PrintAST:
12431246 return withSemanticAnalysis (
12441247 Instance, observer, [](CompilerInstance &Instance) {
0 commit comments