@@ -35,11 +35,6 @@ llvm::ErrorOr<swiftscan_string_ref_t> getTargetInfo(ArrayRef<const char *> Comma
35
35
const char *main_executable_path) {
36
36
llvm::sys::SmartScopedLock<true > Lock (TargetInfoMutex);
37
37
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 ();
43
38
// Parse arguments.
44
39
std::string CommandString;
45
40
for (const auto *c : Command) {
@@ -399,8 +394,7 @@ DependencyScanningTool::initCompilerInstanceForScan(
399
394
StringRef WorkingDir,
400
395
std::shared_ptr<DependencyScanDiagnosticCollector> scannerDiagnosticsCollector) {
401
396
// 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
404
398
llvm::sys::SmartScopedLock<true > Lock (DependencyScanningToolStateLock);
405
399
// FIXME: Instead, target-info and supported-features queries must use
406
400
// `DependencyScanningToolStateLock`, but this currently requires further
@@ -426,11 +420,6 @@ DependencyScanningTool::initCompilerInstanceForScan(
426
420
if (WorkingDirectory.empty ())
427
421
llvm::sys::fs::current_path (WorkingDirectory);
428
422
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 ();
434
423
// Parse/tokenize arguments.
435
424
std::string CommandString;
436
425
for (const auto *c : CommandArgs) {
0 commit comments