@@ -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) {
@@ -399,8 +394,7 @@ DependencyScanningTool::initCompilerInstanceForScan(
399394 StringRef WorkingDir,
400395 std::shared_ptr<DependencyScanDiagnosticCollector> scannerDiagnosticsCollector) {
401396 // The remainder of this method operates on shared state in the
402- // scanning service and global LLVM state with:
403- // llvm::cl::ResetAllOptionOccurrences
397+ // scanning service
404398 llvm::sys::SmartScopedLock<true > Lock (DependencyScanningToolStateLock);
405399 // FIXME: Instead, target-info and supported-features queries must use
406400 // `DependencyScanningToolStateLock`, but this currently requires further
@@ -426,11 +420,6 @@ DependencyScanningTool::initCompilerInstanceForScan(
426420 if (WorkingDirectory.empty ())
427421 llvm::sys::fs::current_path (WorkingDirectory);
428422
429- // We must reset option occurrences because we are handling an unrelated
430- // command-line to those possibly parsed before using the same tool.
431- // We must do so because LLVM options parsing is done using a managed
432- // static `GlobalParser`.
433- llvm::cl::ResetAllOptionOccurrences ();
434423 // Parse/tokenize arguments.
435424 std::string CommandString;
436425 for (const auto *c : CommandArgs) {
0 commit comments