Skip to content

Commit 8576aae

Browse files
Merge pull request #37692 from varungandhi-apple/vg-main
[Migrator] Clear LLVM global state before argument setup.
2 parents 5ded3bc + 4c65e14 commit 8576aae

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Migrator/Migrator.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "clang/Basic/SourceManager.h"
2222
#include "clang/Edit/EditedSource.h"
2323
#include "clang/Rewrite/Core/RewriteBuffer.h"
24+
#include "llvm/Support/CommandLine.h"
2425
#include "llvm/Support/FileSystem.h"
2526

2627
using namespace swift;
@@ -148,6 +149,9 @@ Migrator::performAFixItMigration(version::Version SwiftLanguageVersion) {
148149
}
149150

150151
auto Instance = std::make_unique<swift::CompilerInstance>();
152+
// rdar://78576743 - Reset LLVM global state for command-line arguments set
153+
// by prior calls to setup.
154+
llvm::cl::ResetAllOptionOccurrences();
151155
if (Instance->setup(Invocation)) {
152156
return nullptr;
153157
}

0 commit comments

Comments
 (0)