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:
bors 2017-08-02 01:13:02 +00:00
commit f5f58d0298

View File

@ -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)