Skip to content

Commit 1bc7f8f

Browse files
authored
Auto merge of #37347 - srinivasreddy:llvm, r=eddyb
run rustfmt on librustc_llvm folder
2 parents 87af232 + 9972d17 commit 1bc7f8f

File tree

4 files changed

+314
-508
lines changed

4 files changed

+314
-508
lines changed

src/librustc_llvm/build.rs

+20-21
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,21 @@ fn main() {
2222

2323
let target = env::var("TARGET").expect("TARGET was not set");
2424
let llvm_config = env::var_os("LLVM_CONFIG")
25-
.map(PathBuf::from)
26-
.unwrap_or_else(|| {
27-
if let Some(dir) = env::var_os("CARGO_TARGET_DIR")
28-
.map(PathBuf::from) {
29-
let to_test = dir.parent()
30-
.unwrap()
31-
.parent()
32-
.unwrap()
33-
.join(&target)
34-
.join("llvm/bin/llvm-config");
35-
if Command::new(&to_test).output().is_ok() {
36-
return to_test;
37-
}
38-
}
39-
PathBuf::from("llvm-config")
40-
});
25+
.map(PathBuf::from)
26+
.unwrap_or_else(|| {
27+
if let Some(dir) = env::var_os("CARGO_TARGET_DIR").map(PathBuf::from) {
28+
let to_test = dir.parent()
29+
.unwrap()
30+
.parent()
31+
.unwrap()
32+
.join(&target)
33+
.join("llvm/bin/llvm-config");
34+
if Command::new(&to_test).output().is_ok() {
35+
return to_test;
36+
}
37+
}
38+
PathBuf::from("llvm-config")
39+
});
4140

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

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

69-
let optional_components = ["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", "systemz",
70-
"jsbackend"];
68+
let optional_components =
69+
["x86", "arm", "aarch64", "mips", "powerpc", "pnacl", "systemz", "jsbackend"];
7170

7271
// FIXME: surely we don't need all these components, right? Stuff like mcjit
7372
// or interpreter the compiler itself never uses.
@@ -149,7 +148,7 @@ fn main() {
149148
// that off
150149
lib.trim_right_matches(".lib")
151150
} else {
152-
continue
151+
continue;
153152
};
154153

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

164163
let kind = if name.starts_with("LLVM") {
@@ -179,7 +178,7 @@ fn main() {
179178
cmd.arg("--ldflags");
180179
for lib in output(&mut cmd).split_whitespace() {
181180
if lib.starts_with("-LIBPATH:") {
182-
println!("cargo:rustc-link-search=native={}", &lib[9..]);
181+
println!("cargo:rustc-link-search=native={}", &lib[9..]);
183182
} else if is_crossed {
184183
if lib.starts_with("-L") {
185184
println!("cargo:rustc-link-search=native={}",

src/librustc_llvm/diagnostic.rs

+3-8
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ pub enum OptimizationDiagnosticKind {
3333
impl OptimizationDiagnosticKind {
3434
pub fn describe(self) -> &'static str {
3535
match self {
36-
OptimizationRemark |
37-
OptimizationRemarkOther => "remark",
36+
OptimizationRemark | OptimizationRemarkOther => "remark",
3837
OptimizationMissed => "missed",
3938
OptimizationAnalysis => "analysis",
4039
OptimizationAnalysisFPCommute => "floating-point",
@@ -130,18 +129,14 @@ impl Diagnostic {
130129
Optimization(OptimizationDiagnostic::unpack(OptimizationAnalysis, di))
131130
}
132131

133-
134132
Dk::OptimizationRemarkAnalysisFPCommute => {
135-
Optimization(OptimizationDiagnostic::unpack(
136-
OptimizationAnalysisFPCommute, di))
133+
Optimization(OptimizationDiagnostic::unpack(OptimizationAnalysisFPCommute, di))
137134
}
138135

139136
Dk::OptimizationRemarkAnalysisAliasing => {
140-
Optimization(OptimizationDiagnostic::unpack(
141-
OptimizationAnalysisAliasing, di))
137+
Optimization(OptimizationDiagnostic::unpack(OptimizationAnalysisAliasing, di))
142138
}
143139

144-
145140
Dk::OptimizationFailure => {
146141
Optimization(OptimizationDiagnostic::unpack(OptimizationFailure, di))
147142
}

0 commit comments

Comments
 (0)