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,
368
368
}
369
369
370
370
extern " C" size_t LLVMRustGetTargetFeaturesCount (LLVMTargetMachineRef TM) {
371
- #ifdef LLVM_RUSTLLVM
371
+ #if LLVM_VERSION_GE(18, 0)
372
372
const TargetMachine *Target = unwrap (TM);
373
373
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo ();
374
- const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable ();
374
+ const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getAllProcessorFeatures ();
375
375
return FeatTable.size ();
376
376
#else
377
377
return 0 ;
@@ -380,10 +380,10 @@ extern "C" size_t LLVMRustGetTargetFeaturesCount(LLVMTargetMachineRef TM) {
380
380
381
381
extern " C" void LLVMRustGetTargetFeature (LLVMTargetMachineRef TM, size_t Index,
382
382
const char ** Feature, const char ** Desc) {
383
- #ifdef LLVM_RUSTLLVM
383
+ #if LLVM_VERSION_GE(18, 0)
384
384
const TargetMachine *Target = unwrap (TM);
385
385
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo ();
386
- const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable ();
386
+ const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getAllProcessorFeatures ();
387
387
const SubtargetFeatureKV Feat = FeatTable[Index];
388
388
*Feature = Feat.Key ;
389
389
*Desc = Feat.Desc ;
You can’t perform that action at this time.
0 commit comments