about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-23 22:00:25 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-24 00:05:59 +0200
commit71717b951a2f87720d9d8926e9a21353c120f700 (patch)
treea8044467d195de6ae990c97ed6a0df200017b065
parent3ebca72a11869f946b31f900faffb75c2bb2473a (diff)
downloadrust-71717b951a2f87720d9d8926e9a21353c120f700.tar.gz
rust-71717b951a2f87720d9d8926e9a21353c120f700.zip
Initialize the MSP430 AsmParser if available
-rw-r--r--src/librustc_llvm/build.rs4
-rw-r--r--src/librustc_llvm/lib.rs2
2 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs
index 21fa872c8da..07d2e6dc28c 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 bdf6b091857..dea7e6ae0a2 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,