@@ -148,7 +148,7 @@ pub(crate) fn detect_llvm_sha(config: &Config, is_git: bool) -> String {
148148 "" . to_owned ( )
149149 } ;
150150
151- if & llvm_sha == "" {
151+ if llvm_sha. is_empty ( ) {
152152 eprintln ! ( "error: could not find commit hash for downloading LLVM" ) ;
153153 eprintln ! ( "help: maybe your repository history is too shallow?" ) ;
154154 eprintln ! ( "help: consider disabling `download-ci-llvm`" ) ;
@@ -201,10 +201,10 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {
201201 ( "x86_64-unknown-netbsd" , false ) ,
202202 ] ;
203203
204- if !supported_platforms. contains ( & ( & * config. build . triple , asserts) ) {
205- if asserts == true || !supported_platforms. contains ( & ( & * config. build . triple , true ) ) {
206- return false ;
207- }
204+ if !supported_platforms. contains ( & ( & * config. build . triple , asserts) )
205+ && ( asserts || !supported_platforms. contains ( & ( & * config. build . triple , true ) ) )
206+ {
207+ return false ;
208208 }
209209
210210 if is_ci_llvm_modified ( config) {
@@ -490,11 +490,11 @@ impl Step for Llvm {
490490 let mut cmd = Command :: new ( & res. llvm_config ) ;
491491 let version = output ( cmd. arg ( "--version" ) ) ;
492492 let major = version. split ( '.' ) . next ( ) . unwrap ( ) ;
493- let lib_name = match & llvm_version_suffix {
493+
494+ match & llvm_version_suffix {
494495 Some ( version_suffix) => format ! ( "libLLVM-{major}{version_suffix}.{extension}" ) ,
495496 None => format ! ( "libLLVM-{major}.{extension}" ) ,
496- } ;
497- lib_name
497+ }
498498 } ;
499499
500500 // When building LLVM with LLVM_LINK_LLVM_DYLIB for macOS, an unversioned
@@ -749,13 +749,15 @@ fn configure_cmake(
749749
750750 // For distribution we want the LLVM tools to be *statically* linked to libstdc++.
751751 // We also do this if the user explicitly requested static libstdc++.
752- if builder. config . llvm_static_stdcpp {
753- if !target. contains ( "msvc" ) && !target. contains ( "netbsd" ) && !target. contains ( "solaris" ) {
754- if target. contains ( "apple" ) || target. contains ( "windows" ) {
755- ldflags. push_all ( "-static-libstdc++" ) ;
756- } else {
757- ldflags. push_all ( "-Wl,-Bsymbolic -static-libstdc++" ) ;
758- }
752+ if builder. config . llvm_static_stdcpp
753+ && !target. contains ( "msvc" )
754+ && !target. contains ( "netbsd" )
755+ && !target. contains ( "solaris" )
756+ {
757+ if target. contains ( "apple" ) || target. contains ( "windows" ) {
758+ ldflags. push_all ( "-static-libstdc++" ) ;
759+ } else {
760+ ldflags. push_all ( "-Wl,-Bsymbolic -static-libstdc++" ) ;
759761 }
760762 }
761763
0 commit comments