diff options
| author | Josh Stone <jistone@redhat.com> | 2017-07-31 18:10:01 -0700 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2017-07-31 18:10:01 -0700 |
| commit | 881a7246606cb6ced8ba63a8d58b7e54fed90b7c (patch) | |
| tree | a5ace6976732de292db08c36cd3c546e2919eb3a /src/rustllvm/PassWrapper.cpp | |
| parent | 37c7d0ebb3ec5b62bd37df9ee8826194e3c6300a (diff) | |
| download | rust-881a7246606cb6ced8ba63a8d58b7e54fed90b7c.tar.gz rust-881a7246606cb6ced8ba63a8d58b7e54fed90b7c.zip | |
Gate LLVMRustHasFeature on LLVM_RUSTLLVM
Commit c4710203c098b 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.
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
| -rw-r--r-- | src/rustllvm/PassWrapper.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/rustllvm/PassWrapper.cpp b/src/rustllvm/PassWrapper.cpp index 57e90be2774..bca0881c08c 100644 --- a/src/rustllvm/PassWrapper.cpp +++ b/src/rustllvm/PassWrapper.cpp @@ -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) |
