Skip to content

Commit

Permalink
All supported LLVM versions have MSP430AsmPrinter
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Mar 22, 2021
1 parent 7d872f5 commit b97a33b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
14 changes: 0 additions & 14 deletions compiler/rustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,6 @@ fn main() {
"riscv",
];

let mut version_cmd = Command::new(&llvm_config);
version_cmd.arg("--version");
let version_output = output(&mut version_cmd);
let mut parts = version_output.split('.').take(2).filter_map(|s| s.parse::<u32>().ok());
let (major, _minor) = if let (Some(major), Some(minor)) = (parts.next(), parts.next()) {
(major, minor)
} else {
(8, 0)
};

let required_components = &[
"ipo",
"bitreader",
Expand All @@ -123,10 +113,6 @@ 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");
Expand Down
5 changes: 1 addition & 4 deletions compiler/rustc_llvm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@ pub fn initialize_available_targets() {
LLVMInitializeMSP430TargetInfo,
LLVMInitializeMSP430Target,
LLVMInitializeMSP430TargetMC,
LLVMInitializeMSP430AsmPrinter
);
init_target!(
all(llvm_component = "msp430", llvm_has_msp430_asm_parser),
LLVMInitializeMSP430AsmPrinter,
LLVMInitializeMSP430AsmParser
);
init_target!(
Expand Down

0 comments on commit b97a33b

Please sign in to comment.