Skip to content

Commit 57a7d0f

Browse files
committed
PassWrapper: adapt for llvm/llvm-project@d3d856ad8469
LLVM 21 moves to making it more explicit what this function call is doing, but nothing has changed behaviorally, so for now we just adjust to using the new name of the function. @rustbot label llvm-main
1 parent a932eb3 commit 57a7d0f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,11 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, size_t num_modules,
13651365
// Convert the preserved symbols set from string to GUID, this is then needed
13661366
// for internalization.
13671367
for (size_t i = 0; i < num_symbols; i++) {
1368+
#if LLVM_VERSION_GE(21, 0)
1369+
auto GUID = GlobalValue::getGUIDAssumingExternalLinkage(preserved_symbols[i]);
1370+
#else
13681371
auto GUID = GlobalValue::getGUID(preserved_symbols[i]);
1372+
#endif
13691373
Ret->GUIDPreservedSymbols.insert(GUID);
13701374
}
13711375

@@ -1686,10 +1690,10 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
16861690
#if LLVM_VERSION_GE(21, 0)
16871691
for (auto &Name : Data->Index.cfiFunctionDefs().symbols())
16881692
CfiFunctionDefs.insert(
1689-
GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name)));
1693+
GlobalValue::getGUIDAssumingExternalLinkage(GlobalValue::dropLLVMManglingEscape(Name)));
16901694
for (auto &Name : Data->Index.cfiFunctionDecls().symbols())
16911695
CfiFunctionDecls.insert(
1692-
GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name)));
1696+
GlobalValue::getGUIDAssumingExternalLinkage(GlobalValue::dropLLVMManglingEscape(Name)));
16931697
#else
16941698
for (auto &Name : Data->Index.cfiFunctionDefs())
16951699
CfiFunctionDefs.insert(

0 commit comments

Comments
 (0)