@@ -165,6 +165,10 @@ pub enum PrintRequest {
165165 CrateName ,
166166 Cfg ,
167167 TargetList ,
168+ TargetCPUs ,
169+ TargetFeatures ,
170+ RelocationModels ,
171+ CodeModels ,
168172}
169173
170174pub enum Input {
@@ -1197,6 +1201,24 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
11971201 early_error ( error_format, "Value for codegen units must be a positive nonzero integer" ) ;
11981202 }
11991203
1204+ let mut prints = Vec :: < PrintRequest > :: new ( ) ;
1205+ if cg. target_cpu . as_ref ( ) . map_or ( false , |s| s == "help" ) {
1206+ prints. push ( PrintRequest :: TargetCPUs ) ;
1207+ cg. target_cpu = None ;
1208+ } ;
1209+ if cg. target_feature == "help" {
1210+ prints. push ( PrintRequest :: TargetFeatures ) ;
1211+ cg. target_feature = "" . to_string ( ) ;
1212+ }
1213+ if cg. relocation_model . as_ref ( ) . map_or ( false , |s| s == "help" ) {
1214+ prints. push ( PrintRequest :: RelocationModels ) ;
1215+ cg. relocation_model = None ;
1216+ }
1217+ if cg. code_model . as_ref ( ) . map_or ( false , |s| s == "help" ) {
1218+ prints. push ( PrintRequest :: CodeModels ) ;
1219+ cg. code_model = None ;
1220+ }
1221+
12001222 let cg = cg;
12011223
12021224 let sysroot_opt = matches. opt_str ( "sysroot" ) . map ( |m| PathBuf :: from ( & m) ) ;
@@ -1274,18 +1296,22 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
12741296 let cfg = parse_cfgspecs ( matches. opt_strs ( "cfg" ) ) ;
12751297 let test = matches. opt_present ( "test" ) ;
12761298
1277- let prints = matches. opt_strs ( "print" ) . into_iter ( ) . map ( |s| {
1299+ prints. extend ( matches. opt_strs ( "print" ) . into_iter ( ) . map ( |s| {
12781300 match & * s {
12791301 "crate-name" => PrintRequest :: CrateName ,
12801302 "file-names" => PrintRequest :: FileNames ,
12811303 "sysroot" => PrintRequest :: Sysroot ,
12821304 "cfg" => PrintRequest :: Cfg ,
12831305 "target-list" => PrintRequest :: TargetList ,
1306+ "target-cpus" => PrintRequest :: TargetCPUs ,
1307+ "target-features" => PrintRequest :: TargetFeatures ,
1308+ "relocation-models" => PrintRequest :: RelocationModels ,
1309+ "code-models" => PrintRequest :: CodeModels ,
12841310 req => {
12851311 early_error ( error_format, & format ! ( "unknown print request `{}`" , req) )
12861312 }
12871313 }
1288- } ) . collect :: < Vec < _ > > ( ) ;
1314+ } ) ) ;
12891315
12901316 if !cg. remark . is_empty ( ) && debuginfo == NoDebugInfo {
12911317 early_warn ( error_format, "-C remark will not show source locations without \
0 commit comments