Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,11 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM,
// Just print a bare list of target CPU names, and let Rust-side code handle
// the full formatting of `--print=target-cpus`.
for (auto &CPU : CPUTable) {
#if LLVM_VERSION_GE(23, 0)
OS << CPU.key() << "\n";
#else
OS << CPU.Key << "\n";
#endif
}
}

Expand All @@ -315,9 +319,15 @@ extern "C" void LLVMRustGetTargetFeature(LLVMTargetMachineRef TM, size_t Index,
#endif
const ArrayRef<SubtargetFeatureKV> FeatTable =
MCInfo.getAllProcessorFeatures();
#if LLVM_VERSION_GE(23, 0)
const SubtargetFeatureKV &Feat = FeatTable[Index];
*Feature = Feat.key();
*Desc = Feat.desc();
#else
const SubtargetFeatureKV Feat = FeatTable[Index];
*Feature = Feat.Key;
*Desc = Feat.Desc;
#endif
}

extern "C" const char *LLVMRustGetHostCPUName(size_t *OutLen) {
Expand Down
Loading