@@ -140,6 +140,12 @@ pub struct Config {
140
140
pub llvm_ldflags : Option < String > ,
141
141
pub llvm_use_libcxx : bool ,
142
142
143
+ pub llvm_profile_use : Option < String > ,
144
+ pub llvm_profile_generate : Option < String > ,
145
+ pub llvm_libunwind_default : Option < LlvmLibunwind > ,
146
+ pub llvm_bolt_profile_generate : bool ,
147
+ pub llvm_bolt_profile_use : Option < String > ,
148
+
143
149
// rust codegen options
144
150
pub rust_optimize : bool ,
145
151
pub rust_codegen_units : Option < u32 > ,
@@ -167,11 +173,6 @@ pub struct Config {
167
173
pub rust_profile_use : Option < String > ,
168
174
pub rust_profile_generate : Option < String > ,
169
175
pub rust_lto : RustcLto ,
170
- pub llvm_profile_use : Option < String > ,
171
- pub llvm_profile_generate : bool ,
172
- pub llvm_libunwind_default : Option < LlvmLibunwind > ,
173
- pub llvm_bolt_profile_generate : bool ,
174
- pub llvm_bolt_profile_use : Option < String > ,
175
176
176
177
pub build : TargetSelection ,
177
178
pub hosts : Vec < TargetSelection > ,
@@ -679,6 +680,10 @@ define_config! {
679
680
clang: Option <bool > = "clang" ,
680
681
download_ci_llvm: Option <StringOrBool > = "download-ci-llvm" ,
681
682
build_config: Option <HashMap <String , String >> = "build-config" ,
683
+ profile_generate: Option <String > = "profile-generate" ,
684
+ profile_use: Option <String > = "profile-use" ,
685
+ bolt_profile_generate: Option <bool > = "bolt-profile-generate" ,
686
+ bolt_profile_use: Option <String > = "bolt-profile-use" ,
682
687
}
683
688
}
684
689
@@ -838,17 +843,6 @@ impl Config {
838
843
if let Some ( value) = flags. deny_warnings {
839
844
config. deny_warnings = value;
840
845
}
841
- config. llvm_profile_use = flags. llvm_profile_use ;
842
- config. llvm_profile_generate = flags. llvm_profile_generate ;
843
- config. llvm_bolt_profile_generate = flags. llvm_bolt_profile_generate ;
844
- config. llvm_bolt_profile_use = flags. llvm_bolt_profile_use ;
845
-
846
- if config. llvm_bolt_profile_generate && config. llvm_bolt_profile_use . is_some ( ) {
847
- eprintln ! (
848
- "Cannot use both `llvm_bolt_profile_generate` and `llvm_bolt_profile_use` at the same time"
849
- ) ;
850
- crate :: detail_exit ( 1 ) ;
851
- }
852
846
853
847
// Infer the rest of the configuration.
854
848
@@ -1141,6 +1135,25 @@ impl Config {
1141
1135
// the link step) with each stage.
1142
1136
config. llvm_link_shared . set ( Some ( true ) ) ;
1143
1137
}
1138
+
1139
+ config. llvm_profile_generate = flags. llvm_profile_generate . or ( llvm. profile_generate ) ;
1140
+ config. llvm_profile_use = flags. llvm_profile_use . or ( llvm. profile_use ) ;
1141
+
1142
+ config. llvm_bolt_profile_generate = flags. llvm_bolt_profile_generate ;
1143
+ config. llvm_bolt_profile_use = flags. llvm_bolt_profile_use . or ( llvm. bolt_profile_use ) ;
1144
+ } else {
1145
+ config. llvm_profile_generate = flags. llvm_profile_generate ;
1146
+ config. llvm_profile_use = flags. llvm_profile_use ;
1147
+
1148
+ config. llvm_bolt_profile_generate = flags. llvm_bolt_profile_generate ;
1149
+ config. llvm_bolt_profile_use = flags. llvm_bolt_profile_use ;
1150
+ }
1151
+
1152
+ if config. llvm_bolt_profile_generate && config. llvm_bolt_profile_use . is_some ( ) {
1153
+ eprintln ! (
1154
+ "Cannot use both `llvm_bolt_profile_generate` and `llvm_bolt_profile_use` at the same time"
1155
+ ) ;
1156
+ crate :: detail_exit ( 1 ) ;
1144
1157
}
1145
1158
1146
1159
if let Some ( rust) = toml. rust {
0 commit comments