Auto merge of #43579 - cuviper:extern-llvm-features, r=alexcrichton
Gate LLVMRustHasFeature on LLVM_RUSTLLVM
Commit c4710203c0
in #43492 make `LLVMRustHasFeature` "more robust"
by using `getFeatureTable()`. However, this function is specific to
Rust's own LLVM fork, not upstream LLVM-4.0, so we need to use
`#if LLVM_RUSTLLVM` to guard this call.
Closes #43555.
This commit is contained in:
commit
f5f58d0298
@ -178,10 +178,10 @@ GEN_SUBTARGETS
|
||||
|
||||
extern "C" bool LLVMRustHasFeature(LLVMTargetMachineRef TM,
|
||||
const char *Feature) {
|
||||
#if LLVM_RUSTLLVM
|
||||
TargetMachine *Target = unwrap(TM);
|
||||
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
|
||||
const FeatureBitset &Bits = MCInfo->getFeatureBits();
|
||||
#if LLVM_VERSION_GE(4, 0)
|
||||
const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable();
|
||||
|
||||
for (auto &FeatureEntry : FeatTable)
|
||||
|
Loading…
Reference in New Issue
Block a user