Skip to content

Commit 94265e8

Browse files
authored
[Frontend] Add a comment about 9e6d4db (#27169)
With wording help from David U.
1 parent 4230cf7 commit 94265e8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/FrontendTool/FrontendTool.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,14 @@ static bool performCompile(CompilerInstance &Instance,
11221122
if (Action == FrontendOptions::ActionType::Typecheck) {
11231123
if (emitIndexData(Invocation, Instance))
11241124
return true;
1125+
// FIXME: Whole-module outputs with a non-whole-module -typecheck ought to
1126+
// be disallowed, but the driver implements -index-file mode by generating a
1127+
// regular whole-module frontend command line and modifying it to index just
1128+
// one file (by making it a primary) instead of all of them. If that
1129+
// invocation also has flags to emit whole-module supplementary outputs, the
1130+
// compiler can crash trying to access information for non-type-checked
1131+
// declarations in the non-primary files. For now, prevent those crashes by
1132+
// guarding the emission of whole-module supplementary outputs.
11251133
if (opts.InputsAndOutputs.isWholeModule()) {
11261134
if (emitAnyWholeModulePostTypeCheckSupplementaryOutputs(Instance,
11271135
Invocation,

0 commit comments

Comments
 (0)