Skip to content

Commit 3618e63

Browse files
committed
Add support for ignoring -index-file
1 parent d31e473 commit 3618e63

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

include/swift/AST/DiagnosticsDriver.def

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ WARNING(warn_ignoring_batch_mode, none,
169169
"ignoring '-enable-batch-mode' because '%0' was also specified",
170170
(StringRef))
171171

172-
WARNING(warn_ignoring_wmo, none,
173-
"ignoring '-wmo' because '-dump-ast' was also specified", ())
172+
WARNING(warn_ignoring_single_compile, none,
173+
"ignoring '%0' because '-dump-ast' was also specified", (StringRef))
174174

175175
WARNING(warn_ignoring_source_range_dependencies,none,
176176
"ignoring '-enable-source-range-dependencies' because '%0' was also specified", (StringRef))

lib/Driver/Driver.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1758,12 +1758,13 @@ Driver::computeCompilerMode(const DerivedArgList &Args,
17581758
const Arg *ArgRequiringSinglePrimaryCompile =
17591759
Args.getLastArg(options::OPT_enable_source_range_dependencies);
17601760

1761-
// AST dump doesn't work in WMO. Since it's not common want to dump the AST,
1762-
// we assume that's the priority and ignore `-wmo`, but we warn the user about
1763-
// this decision.
1764-
if (Args.hasArg(options::OPT_whole_module_optimization) &&
1761+
// AST dump doesn't work with `-wmo` or `-index-file`. Since it's not common
1762+
// to want to dump the AST, we assume that's the priority and ignore the
1763+
// conflicting option, but we warn the user about this decision.
1764+
if (ArgRequiringSingleCompile &&
17651765
Args.hasArg(options::OPT_dump_ast)) {
1766-
Diags.diagnose(SourceLoc(), diag::warn_ignoring_wmo);
1766+
Diags.diagnose(SourceLoc(), diag::warn_ignoring_single_compile,
1767+
ArgRequiringSingleCompile->getOption().getPrefixedName());
17671768
return OutputInfo::Mode::StandardCompile;
17681769
}
17691770

0 commit comments

Comments
 (0)