This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
compiler/rustc_llvm/llvm-wrapper Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -368,10 +368,10 @@ extern "C" void LLVMRustPrintTargetCPUs(LLVMTargetMachineRef TM,
368368}
369369
370370extern " C" size_t LLVMRustGetTargetFeaturesCount (LLVMTargetMachineRef TM) {
371- #ifdef LLVM_RUSTLLVM
371+ #if LLVM_VERSION_GE(18, 0)
372372 const TargetMachine *Target = unwrap (TM);
373373 const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo ();
374- const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable ();
374+ const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getAllProcessorFeatures ();
375375 return FeatTable.size ();
376376#else
377377 return 0 ;
@@ -380,10 +380,10 @@ extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) {
380380
381381extern " C" void LLVMRustGetTargetFeature (LLVMTargetMachineRef TM, size_t Index,
382382 const char ** Feature, const char ** Desc) {
383- #ifdef LLVM_RUSTLLVM
383+ #if LLVM_VERSION_GE(18, 0)
384384 const TargetMachine *Target = unwrap (TM);
385385 const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo ();
386- const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable ();
386+ const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getAllProcessorFeatures ();
387387 const SubtargetFeatureKV Feat = FeatTable[Index];
388388 *Feature = Feat.Key ;
389389 *Desc = Feat.Desc ;
You can’t perform that action at this time.
0 commit comments