Skip to content

Commit 881a724

Browse files
committed
Gate LLVMRustHasFeature on LLVM_RUSTLLVM
Commit c471020 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.
1 parent 37c7d0e commit 881a724

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rustllvm/PassWrapper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ GEN_SUBTARGETS
178178

179179
extern "C" bool LLVMRustHasFeature(LLVMTargetMachineRef TM,
180180
const char *Feature) {
181+
#if LLVM_RUSTLLVM
181182
TargetMachine *Target = unwrap(TM);
182183
const MCSubtargetInfo *MCInfo = Target->getMCSubtargetInfo();
183184
const FeatureBitset &Bits = MCInfo->getFeatureBits();
184-
#if LLVM_VERSION_GE(4, 0)
185185
const ArrayRef<SubtargetFeatureKV> FeatTable = MCInfo->getFeatureTable();
186186

187187
for (auto &FeatureEntry : FeatTable)

0 commit comments

Comments
 (0)