Skip to content

Commit f5f58d0

Browse files
committed
Auto merge of #43579 - cuviper:extern-llvm-features, r=alexcrichton
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. Closes #43555.
2 parents 640cfc8 + 881a724 commit f5f58d0

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)