Skip to content

Commit 8c67c54

Browse files
igorban-inteligcbot
authored andcommitted
Deallocate all LLVM-internal structures
.
1 parent af7b1c8 commit 8c67c54

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

IGC/VectorCompiler/lib/Driver/Driver.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ SPDX-License-Identifier: MIT
6363

6464
using namespace llvm;
6565

66+
// Custom destructor for cleaning up all LLVM ManagedStatic allocated instances
67+
static const auto StaticLLVMObjectsDestructor =
68+
llvm::make_scope_exit([]() { llvm::llvm_shutdown(); });
69+
6670
static Expected<std::unique_ptr<llvm::Module>>
6771
getModuleFromLLVMText(ArrayRef<char> Input, LLVMContext &C) {
6872
SMDiagnostic Err;

0 commit comments

Comments
 (0)