Skip to content

Commit ae5b350

Browse files
committed
Handle some renamed ThinLTO functions
1 parent 7be0b23 commit ae5b350

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
@@ -922,7 +922,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules,
922922
GlobalValue::LinkageTypes NewLinkage) {
923923
ResolvedODR[ModuleIdentifier][GUID] = NewLinkage;
924924
};
925+
#if LLVM_VERSION_GE(8, 0)
926+
thinLTOResolvePrevailingInIndex(Ret->Index, isPrevailing, recordNewLinkage);
927+
#else
925928
thinLTOResolveWeakForLinkerInIndex(Ret->Index, isPrevailing, recordNewLinkage);
929+
#endif
926930

927931
// Here we calculate an `ExportedGUIDs` set for use in the `isExported`
928932
// callback below. This callback below will dictate the linkage for all
@@ -977,7 +981,11 @@ extern "C" bool
977981
LLVMRustPrepareThinLTOResolveWeak(const LLVMRustThinLTOData *Data, LLVMModuleRef M) {
978982
Module &Mod = *unwrap(M);
979983
const auto &DefinedGlobals = Data->ModuleToDefinedGVSummaries.lookup(Mod.getModuleIdentifier());
984+
#if LLVM_VERSION_GE(8, 0)
985+
thinLTOResolvePrevailingInModule(Mod, DefinedGlobals);
986+
#else
980987
thinLTOResolveWeakForLinkerModule(Mod, DefinedGlobals);
988+
#endif
981989
return true;
982990
}
983991

0 commit comments

Comments
 (0)