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.
This commit is contained in:
parent
37c7d0ebb3
commit
881a724660
@ -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