Skip to content

Commit 3e1c57c

Browse files
authored
Unrolled build for rust-lang#140400
Rollup merge of rust-lang#140400 - durin42:llvm-21-getguid, r=cuviper 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
2 parents efcbb94 + ff6dad4 commit 3e1c57c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+9-4
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,12 @@ 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 =
1370+
GlobalValue::getGUIDAssumingExternalLinkage(preserved_symbols[i]);
1371+
#else
13681372
auto GUID = GlobalValue::getGUID(preserved_symbols[i]);
1373+
#endif
13691374
Ret->GUIDPreservedSymbols.insert(GUID);
13701375
}
13711376

@@ -1685,11 +1690,11 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut,
16851690
// Based on the 'InProcessThinBackend' constructor in LLVM
16861691
#if LLVM_VERSION_GE(21, 0)
16871692
for (auto &Name : Data->Index.cfiFunctionDefs().symbols())
1688-
CfiFunctionDefs.insert(
1689-
GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name)));
1693+
CfiFunctionDefs.insert(GlobalValue::getGUIDAssumingExternalLinkage(
1694+
GlobalValue::dropLLVMManglingEscape(Name)));
16901695
for (auto &Name : Data->Index.cfiFunctionDecls().symbols())
1691-
CfiFunctionDecls.insert(
1692-
GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name)));
1696+
CfiFunctionDecls.insert(GlobalValue::getGUIDAssumingExternalLinkage(
1697+
GlobalValue::dropLLVMManglingEscape(Name)));
16931698
#else
16941699
for (auto &Name : Data->Index.cfiFunctionDefs())
16951700
CfiFunctionDefs.insert(

0 commit comments

Comments
 (0)