diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2025-05-01 10:22:16 +0300 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2025-05-01 10:22:16 +0300 |
| commit | 1c5de64814d72effc6890ca823fa4d248041a0bd (patch) | |
| tree | 9375885343e27ab26b20dfe5a3714e00d5d378d0 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | b01b98f9f0b350badf8390e7950759d78484622d (diff) | |
| parent | 6e23095adf9209614a45f7f75fea36dad7b92afb (diff) | |
| download | rust-1c5de64814d72effc6890ca823fa4d248041a0bd.tar.gz rust-1c5de64814d72effc6890ca823fa4d248041a0bd.zip | |
Merge from rust-lang/rust
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
| -rw-r--r-- | compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp index 8bee051dd4c..ebe8eb57f2c 100644 --- a/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp +++ b/compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp @@ -1365,7 +1365,12 @@ LLVMRustCreateThinLTOData(LLVMRustThinLTOModule *modules, size_t num_modules, // Convert the preserved symbols set from string to GUID, this is then needed // for internalization. for (size_t i = 0; i < num_symbols; i++) { +#if LLVM_VERSION_GE(21, 0) + auto GUID = + GlobalValue::getGUIDAssumingExternalLinkage(preserved_symbols[i]); +#else auto GUID = GlobalValue::getGUID(preserved_symbols[i]); +#endif Ret->GUIDPreservedSymbols.insert(GUID); } @@ -1685,11 +1690,11 @@ extern "C" void LLVMRustComputeLTOCacheKey(RustStringRef KeyOut, // Based on the 'InProcessThinBackend' constructor in LLVM #if LLVM_VERSION_GE(21, 0) for (auto &Name : Data->Index.cfiFunctionDefs().symbols()) - CfiFunctionDefs.insert( - GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name))); + CfiFunctionDefs.insert(GlobalValue::getGUIDAssumingExternalLinkage( + GlobalValue::dropLLVMManglingEscape(Name))); for (auto &Name : Data->Index.cfiFunctionDecls().symbols()) - CfiFunctionDecls.insert( - GlobalValue::getGUID(GlobalValue::dropLLVMManglingEscape(Name))); + CfiFunctionDecls.insert(GlobalValue::getGUIDAssumingExternalLinkage( + GlobalValue::dropLLVMManglingEscape(Name))); #else for (auto &Name : Data->Index.cfiFunctionDefs()) CfiFunctionDefs.insert( |
