File tree 2 files changed +15
-14
lines changed
2 files changed +15
-14
lines changed Original file line number Diff line number Diff line change @@ -88,9 +88,6 @@ impl LdFlags {
88
88
/// This will return the llvm-config if it can get it (but it will not build it
89
89
/// if not).
90
90
pub fn prebuilt_llvm_config ( builder : & Builder < ' _ > , target : TargetSelection ) -> LlvmBuildStatus {
91
- // If we have llvm submodule initialized already, sync it.
92
- builder. update_existing_submodule ( "src/llvm-project" ) ;
93
-
94
91
builder. config . maybe_download_ci_llvm ( ) ;
95
92
96
93
// If we're using a custom LLVM bail out here, but we can only use a
@@ -109,10 +106,6 @@ pub fn prebuilt_llvm_config(builder: &Builder<'_>, target: TargetSelection) -> L
109
106
}
110
107
}
111
108
112
- // Initialize the llvm submodule if not initialized already.
113
- // If submodules are disabled, this does nothing.
114
- builder. config . update_submodule ( "src/llvm-project" ) ;
115
-
116
109
let root = "src/llvm-project/llvm" ;
117
110
let out_dir = builder. llvm_out ( target) ;
118
111
Original file line number Diff line number Diff line change @@ -2737,6 +2737,12 @@ impl Config {
2737
2737
) -> bool {
2738
2738
let download_ci_llvm = download_ci_llvm. unwrap_or ( StringOrBool :: Bool ( true ) ) ;
2739
2739
2740
+ let update_llvm_submodule = || {
2741
+ // Fetching the LLVM submodule is unnecessary for self-tests.
2742
+ #[ cfg( not( feature = "bootstrap-self-test" ) ) ]
2743
+ self . update_submodule ( "src/llvm-project" ) ;
2744
+ } ;
2745
+
2740
2746
let if_unchanged = || {
2741
2747
if self . rust_info . is_from_tarball ( ) {
2742
2748
// Git is needed for running "if-unchanged" logic.
@@ -2746,9 +2752,7 @@ impl Config {
2746
2752
return false ;
2747
2753
}
2748
2754
2749
- // Fetching the LLVM submodule is unnecessary for self-tests.
2750
- #[ cfg( not( feature = "bootstrap-self-test" ) ) ]
2751
- self . update_submodule ( "src/llvm-project" ) ;
2755
+ update_llvm_submodule ( ) ;
2752
2756
2753
2757
// Check for untracked changes in `src/llvm-project`.
2754
2758
let has_changes = self
@@ -2761,10 +2765,14 @@ impl Config {
2761
2765
2762
2766
match download_ci_llvm {
2763
2767
StringOrBool :: Bool ( b) => {
2764
- if !b && self . download_rustc_commit . is_some ( ) {
2765
- panic ! (
2766
- "`llvm.download-ci-llvm` cannot be set to `false` if `rust.download-rustc` is set to `true` or `if-unchanged`."
2767
- ) ;
2768
+ if !b {
2769
+ if self . download_rustc_commit . is_some ( ) {
2770
+ panic ! (
2771
+ "`llvm.download-ci-llvm` cannot be set to `false` if `rust.download-rustc` is set to `true` or `if-unchanged`."
2772
+ ) ;
2773
+ }
2774
+
2775
+ update_llvm_submodule ( ) ;
2768
2776
}
2769
2777
2770
2778
// If download-ci-llvm=true we also want to check that CI llvm is available
You can’t perform that action at this time.
0 commit comments