IRGen: Add force import thunk to used globals on windows

LLVM's new pass pipeline will otherwise remove the internal symbol.
This commit is contained in:
Arnold Schwaighofer
2022-07-26 05:43:45 -07:00
parent d7f8e11a79
commit 10ec81edf0

View File

@@ -1619,6 +1619,7 @@ static llvm::GlobalObject *createForceImportThunk(IRGenModule &IGM) {
auto BB = llvm::BasicBlock::Create(IGM.getLLVMContext(), "", ForceImportThunk);
llvm::IRBuilder<> IRB(BB);
IRB.CreateRetVoid();
IGM.addUsedGlobal(ForceImportThunk);
return ForceImportThunk;
}
}