Skip to content

run rustfmt on librustc_llvm folder #37347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions src/librustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,21 @@ fn main() {

let target = env::var("TARGET").expect("TARGET was not set");
let llvm_config = env::var_os("LLVM_CONFIG")
.map(PathBuf::from)
.unwrap_or_else(|| {
if let Some(dir) = env::var_os("CARGO_TARGET_DIR")
.map(PathBuf::from) {
let to_test = dir.parent()
.unwrap()
.parent()
.unwrap()
.join(&target)
.join("llvm/bin/llvm-config");
if Command::new(&to_test).output().is_ok() {
return to_test;
}
}
PathBuf::from("llvm-config")
});
.map(PathBuf::from)
.unwrap_or_else(|| {
if let Some(dir) = env::var_os("CARGO_TARGET_DIR").map(PathBuf::from) {
let to_test = dir.parent()
.unwrap()
.parent()
.unwrap()
.join(&target)
.join("llvm/bin/llvm-config");
if Command::new(&to_test).output().is_ok() {
return to_test;
}
}
PathBuf::from("llvm-config")
});

println!("cargo:rerun-if-changed={}", llvm_config.display());

Expand Down Expand Up @@ -66,8 +65,8 @@ fn main() {
let host = env::var("HOST").expect("HOST was not set");
let is_crossed = target != host;

let optional_components = ["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", "systemz",
"jsbackend"];
let optional_components =
["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", "systemz", "jsbackend"];

// FIXME: surely we don't need all these components, right? Stuff like mcjit
// or interpreter the compiler itself never uses.
Expand Down Expand Up @@ -149,7 +148,7 @@ fn main() {
// that off
lib.trim_right_matches(".lib")
} else {
continue
continue;
};

// Don't need or want this library, but LLVM's CMake build system
Expand All @@ -158,7 +157,7 @@ fn main() {
// library and it otherwise may just pull in extra dependencies on
// libedit which we don't want
if name == "LLVMLineEditor" {
continue
continue;
}

let kind = if name.starts_with("LLVM") {
Expand All @@ -179,7 +178,7 @@ fn main() {
cmd.arg("--ldflags");
for lib in output(&mut cmd).split_whitespace() {
if lib.starts_with("-LIBPATH:") {
println!("cargo:rustc-link-search=native={}", &lib[9..]);
println!("cargo:rustc-link-search=native={}", &lib[9..]);
} else if is_crossed {
if lib.starts_with("-L") {
println!("cargo:rustc-link-search=native={}",
Expand Down
11 changes: 3 additions & 8 deletions src/librustc_llvm/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ pub enum OptimizationDiagnosticKind {
impl OptimizationDiagnosticKind {
pub fn describe(self) -> &'static str {
match self {
OptimizationRemark |
OptimizationRemarkOther => "remark",
OptimizationRemark | OptimizationRemarkOther => "remark",
OptimizationMissed => "missed",
OptimizationAnalysis => "analysis",
OptimizationAnalysisFPCommute => "floating-point",
Expand Down Expand Up @@ -130,18 +129,14 @@ impl Diagnostic {
Optimization(OptimizationDiagnostic::unpack(OptimizationAnalysis, di))
}


Dk::OptimizationRemarkAnalysisFPCommute => {
Optimization(OptimizationDiagnostic::unpack(
OptimizationAnalysisFPCommute, di))
Optimization(OptimizationDiagnostic::unpack(OptimizationAnalysisFPCommute, di))
}

Dk::OptimizationRemarkAnalysisAliasing => {
Optimization(OptimizationDiagnostic::unpack(
OptimizationAnalysisAliasing, di))
Optimization(OptimizationDiagnostic::unpack(OptimizationAnalysisAliasing, di))
}


Dk::OptimizationFailure => {
Optimization(OptimizationDiagnostic::unpack(OptimizationFailure, di))
}
Expand Down
Loading