Skip to content

Commit 2f6946a

Browse files
committed
Handle some renamed ThinLTO functions
1 parent 02940d5 commit 2f6946a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/rustllvm/PassWrapper.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
953953
GlobalValue::LinkageTypes NewLinkage) {
954954
ResolvedODR[ModuleIdentifier][GUID] = NewLinkage;
955955
};
956+
#if LLVM_VERSION_GE(8, 0)
957+
thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage);
958+
#else
956959
thinLTOResolveWeakForLinkerInIndex(Ret->Index, isPrevailing, recordNewLinkage);
960+
#endif
957961

958962
// Here we calculate an `ExportedGUIDs` set for use in the `isExported`
959963
// callback below. This callback below will dictate the linkage for all
@@ -1016,7 +1020,11 @@ extern "C" bool
10161020
LLVMRustPrepareThinLTOResolveWeak(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
10171021
Module &Mod = *unwrap(M);
10181022
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(Mod.getModuleIdentifier());
1023+
#if LLVM_VERSION_GE(8, 0)
1024+
thinLTOResolvePrevailingInModule(Mod, DefinedGlobals);
1025+
#else
10191026
thinLTOResolveWeakForLinkerModule(Mod, DefinedGlobals);
1027+
#endif
10201028
return true;
10211029
}
10221030

0 commit comments

Comments
 (0)