From 71717b951a2f87720d9d8926e9a21353c120f700 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 23 Jul 2019 22:00:25 +0200 Subject: [PATCH] Initialize the MSP430 AsmParser if available --- src/librustc_llvm/build.rs | 4 ++++ src/librustc_llvm/lib.rs | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs index 21fa872c8dadb..07d2e6dc28c2c 100644 --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs @@ -119,6 +119,10 @@ fn main() { println!("cargo:rustc-cfg=llvm_component=\"{}\"", component); } + if major >= 9 { + println!("cargo:rustc-cfg=llvm_has_msp430_asm_parser"); + } + // Link in our own LLVM shims, compiled with the same flags as LLVM let mut cmd = Command::new(&llvm_config); cmd.arg("--cxxflags"); diff --git a/src/librustc_llvm/lib.rs b/src/librustc_llvm/lib.rs index bdf6b09185735..dea7e6ae0a2ab 100644 --- a/src/librustc_llvm/lib.rs +++ b/src/librustc_llvm/lib.rs @@ -76,6 +76,8 @@ pub fn initialize_available_targets() { LLVMInitializeMSP430Target, LLVMInitializeMSP430TargetMC, LLVMInitializeMSP430AsmPrinter); + init_target!(all(llvm_component = "msp430", llvm_has_msp430_asm_parser), + LLVMInitializeMSP430AsmParser); init_target!(llvm_component = "riscv", LLVMInitializeRISCVTargetInfo, LLVMInitializeRISCVTarget,