@@ -726,6 +726,7 @@ mod desc {
726726 pub ( crate ) const parse_list_with_polarity: & str =
727727 "a comma-separated list of strings, with elements beginning with + or -" ;
728728 pub ( crate ) const parse_autodiff: & str = "a comma separated list of settings: `Enable`, `PrintSteps`, `PrintTA`, `PrintTAFn`, `PrintAA`, `PrintPerf`, `PrintModBefore`, `PrintModAfter`, `PrintModFinal`, `PrintPasses`, `NoPostopt`, `LooseTypes`, `Inline`" ;
729+ pub ( crate ) const parse_offload: & str = "a comma separated list of settings: `Enable`" ;
729730 pub ( crate ) const parse_comma_list: & str = "a comma-separated list of strings" ;
730731 pub ( crate ) const parse_opt_comma_list: & str = parse_comma_list;
731732 pub ( crate ) const parse_number: & str = "a number" ;
@@ -1357,6 +1358,27 @@ pub mod parse {
13571358 }
13581359 }
13591360
1361+ pub ( crate ) fn parse_offload ( slot : & mut Vec < Offload > , v : Option < & str > ) -> bool {
1362+ let Some ( v) = v else {
1363+ * slot = vec ! [ ] ;
1364+ return true ;
1365+ } ;
1366+ let mut v: Vec < & str > = v. split ( "," ) . collect ( ) ;
1367+ v. sort_unstable ( ) ;
1368+ for & val in v. iter ( ) {
1369+ let variant = match val {
1370+ "Enable" => Offload :: Enable ,
1371+ _ => {
1372+ // FIXME(ZuseZ4): print an error saying which value is not recognized
1373+ return false ;
1374+ }
1375+ } ;
1376+ slot. push ( variant) ;
1377+ }
1378+
1379+ true
1380+ }
1381+
13601382 pub ( crate ) fn parse_autodiff ( slot : & mut Vec < AutoDiff > , v : Option < & str > ) -> bool {
13611383 let Some ( v) = v else {
13621384 * slot = vec ! [ ] ;
@@ -2399,6 +2421,11 @@ options! {
23992421 "do not use unique names for text and data sections when -Z function-sections is used" ) ,
24002422 normalize_docs: bool = ( false , parse_bool, [ TRACKED ] ,
24012423 "normalize associated items in rustdoc when generating documentation" ) ,
2424+ offload: Vec <crate :: config:: Offload > = ( Vec :: new( ) , parse_offload, [ TRACKED ] ,
2425+ "a list of offload flags to enable
2426+ Mandatory setting:
2427+ `=Enable`
2428+ Currently the only option available" ) ,
24022429 on_broken_pipe: OnBrokenPipe = ( OnBrokenPipe :: Default , parse_on_broken_pipe, [ TRACKED ] ,
24032430 "behavior of std::io::ErrorKind::BrokenPipe (SIGPIPE)" ) ,
24042431 oom: OomStrategy = ( OomStrategy :: Abort , parse_oom_strategy, [ TRACKED ] ,
0 commit comments