Skip to content

Commit 06a8902

Browse files
authored
Merge pull request swiftlang#36392 from artemcm/BatchScannerResetOptionOccurences
[DependencyScanning] Reset LLVM option occurences for each batch scan entry
2 parents b80ca8e + c96c511 commit 06a8902

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/DependencyScan/ScanDependencies.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,11 @@ forEachBatchEntry(CompilerInstance &invocationInstance,
982982
// those of the current scanner invocation.
983983
updateCachedInstanceOpts(*pInstance, invocationInstance, entry.arguments);
984984
} else {
985+
// We must reset option occurences because we are handling an unrelated command-line
986+
// to those parsed before. We must do so because LLVM options parsing is done
987+
// using a managed static `GlobalParser`.
988+
llvm::cl::ResetAllOptionOccurrences();
989+
985990
// Create a new instance by the arguments and save it in the map.
986991
subInstanceMap->insert(
987992
{entry.arguments,

0 commit comments

Comments
 (0)