@@ -35,11 +35,6 @@ llvm::ErrorOr<swiftscan_string_ref_t> getTargetInfo(ArrayRef<const char *> Comma
3535 const char *main_executable_path) {
3636 llvm::sys::SmartScopedLock<true > Lock (TargetInfoMutex);
3737
38- // We must reset option occurrences because we are handling an unrelated
39- // command-line to those possibly parsed before using the same tool.
40- // We must do so because LLVM options parsing is done using a managed
41- // static `GlobalParser`.
42- llvm::cl::ResetAllOptionOccurrences ();
4338 // Parse arguments.
4439 std::string CommandString;
4540 for (const auto *c : Command) {
@@ -411,8 +406,7 @@ DependencyScanningTool::initCompilerInstanceForScan(
411406 StringRef WorkingDir,
412407 std::shared_ptr<DependencyScanDiagnosticCollector> scannerDiagnosticsCollector) {
413408 // The remainder of this method operates on shared state in the
414- // scanning service and global LLVM state with:
415- // llvm::cl::ResetAllOptionOccurrences
409+ // scanning service
416410 llvm::sys::SmartScopedLock<true > Lock (DependencyScanningToolStateLock);
417411 // FIXME: Instead, target-info and supported-features queries must use
418412 // `DependencyScanningToolStateLock`, but this currently requires further
@@ -438,11 +432,6 @@ DependencyScanningTool::initCompilerInstanceForScan(
438432 if (WorkingDirectory.empty ())
439433 llvm::sys::fs::current_path (WorkingDirectory);
440434
441- // We must reset option occurrences because we are handling an unrelated
442- // command-line to those possibly parsed before using the same tool.
443- // We must do so because LLVM options parsing is done using a managed
444- // static `GlobalParser`.
445- llvm::cl::ResetAllOptionOccurrences ();
446435 // Parse/tokenize arguments.
447436 std::string CommandString;
448437 for (const auto *c : CommandArgs) {
0 commit comments