about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-07-26 18:56:50 +0200
committerGitHub <noreply@github.com>2019-07-26 18:56:50 +0200
commit183aab3575ebd7c82ce1e982fa335b9a84388d12 (patch)
treeb55cf7c09ca2aaa951b2fba74961bdb8154fe641
parentba835dffe68148734d82b8d8b4aa2b96b5750f52 (diff)
parent71717b951a2f87720d9d8926e9a21353c120f700 (diff)
downloadrust-183aab3575ebd7c82ce1e982fa335b9a84388d12.tar.gz
rust-183aab3575ebd7c82ce1e982fa335b9a84388d12.zip
Rollup merge of #62907 - nikic:msp430-asmparser, r=alexcrichton
Initialize the MSP430 AsmParser

Hopefully fixes #59077.

r? @alexcrichton
-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 3def2d8232f..16cdbb7dd4d 100644
--- a/src/librustc_llvm/build.rs
+++ b/src/librustc_llvm/build.rs
@@ -112,6 +112,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,