Skip to content

Commit 8bcdfb2

Browse files
committed
Swift: initialize LLVM
No need to shutdown LLVM, it's done by the PROGRAM_START macro
1 parent 462133e commit 8bcdfb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

swift/extractor/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ int main(int argc, char** argv) {
4040
if ("-frontend"s != argv[1]) {
4141
return 0;
4242
}
43+
// Required by Swift/LLVM
4344
PROGRAM_START(argc, argv);
45+
INITIALIZE_LLVM();
4446

4547
codeql::Configuration configuration{};
4648
configuration.trapDir = getenv_or("CODEQL_EXTRACTOR_SWIFT_TRAP_DIR", ".");
@@ -55,6 +57,5 @@ int main(int argc, char** argv) {
5557
std::copy(std::begin(args), std::end(args), std::back_inserter(configuration.frontendOptions));
5658
Observer observer(configuration);
5759
int frontend_rc = swift::performFrontend(args, "swift-extractor", (void*)main, &observer);
58-
llvm::llvm_shutdown();
5960
return frontend_rc;
6061
}

0 commit comments

Comments
 (0)