@@ -176,6 +176,10 @@ pub enum PrintRequest {
176176    CrateName , 
177177    Cfg , 
178178    TargetList , 
179+     TargetCPUs , 
180+     TargetFeatures , 
181+     RelocationModels , 
182+     CodeModels , 
179183} 
180184
181185pub  enum  Input  { 
@@ -629,9 +633,9 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
629633    lto:  bool  = ( false ,  parse_bool, 
630634        "perform LLVM link-time optimizations" ) , 
631635    target_cpu:  Option <String > = ( None ,  parse_opt_string, 
632-         "select target processor (llc -mcpu=help  for details)" ) , 
636+         "select target processor (rustc --print target-cpus  for details)" ) , 
633637    target_feature:  String  = ( "" . to_string( ) ,  parse_string, 
634-         "target specific attributes (llc -mattr=help  for details)" ) , 
638+         "target specific attributes (rustc --print target-features  for details)" ) , 
635639    passes:  Vec <String > = ( Vec :: new( ) ,  parse_list, 
636640        "a list of extra LLVM passes to run (space separated)" ) , 
637641    llvm_args:  Vec <String > = ( Vec :: new( ) ,  parse_list, 
@@ -655,9 +659,9 @@ options! {CodegenOptions, CodegenSetter, basic_codegen_options,
655659    no_redzone:  Option <bool > = ( None ,  parse_opt_bool, 
656660        "disable the use of the redzone" ) , 
657661    relocation_model:  Option <String > = ( None ,  parse_opt_string, 
658-          "choose the relocation model to use (llc - relocation-model  for details)" ) , 
662+          "choose the relocation model to use (rustc --print  relocation-models  for details)" ) , 
659663    code_model:  Option <String > = ( None ,  parse_opt_string, 
660-          "choose the code model to use (llc - code-model  for details)" ) , 
664+          "choose the code model to use (rustc --print  code-models  for details)" ) , 
661665    metadata:  Vec <String > = ( Vec :: new( ) ,  parse_list, 
662666         "metadata to mangle symbol names with" ) , 
663667    extra_filename:  String  = ( "" . to_string( ) ,  parse_string, 
@@ -1024,7 +1028,8 @@ pub fn rustc_short_optgroups() -> Vec<RustcOptGroup> {
10241028                 "[asm|llvm-bc|llvm-ir|obj|link|dep-info]" ) , 
10251029        opt:: multi_s( "" ,  "print" ,  "Comma separated list of compiler information to \  
10261030, 
1027-                  "[crate-name|file-names|sysroot|cfg|target-list]" ) , 
1031+                  "[crate-name|file-names|sysroot|cfg|target-list|target-cpus|\  
1032+ ) , 
10281033        opt:: flagmulti_s( "g" ,   "" ,   "Equivalent to -C debuginfo=2" ) , 
10291034        opt:: flagmulti_s( "O" ,  "" ,  "Equivalent to -C opt-level=2" ) , 
10301035        opt:: opt_s( "o" ,  "" ,  "Write output to <filename>" ,  "FILENAME" ) , 
@@ -1238,6 +1243,24 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
12381243        early_error ( error_format,  "Value for codegen units must be a positive nonzero integer" ) ; 
12391244    } 
12401245
1246+     let  mut  prints = Vec :: < PrintRequest > :: new ( ) ; 
1247+     if  cg. target_cpu . as_ref ( ) . map_or ( false ,  |s| s == "help" )  { 
1248+         prints. push ( PrintRequest :: TargetCPUs ) ; 
1249+         cg. target_cpu  = None ; 
1250+     } ; 
1251+     if  cg. target_feature  == "help"  { 
1252+         prints. push ( PrintRequest :: TargetFeatures ) ; 
1253+         cg. target_feature  = "" . to_string ( ) ; 
1254+     } 
1255+     if  cg. relocation_model . as_ref ( ) . map_or ( false ,  |s| s == "help" )  { 
1256+         prints. push ( PrintRequest :: RelocationModels ) ; 
1257+         cg. relocation_model  = None ; 
1258+     } 
1259+     if  cg. code_model . as_ref ( ) . map_or ( false ,  |s| s == "help" )  { 
1260+         prints. push ( PrintRequest :: CodeModels ) ; 
1261+         cg. code_model  = None ; 
1262+     } 
1263+ 
12411264    let  cg = cg; 
12421265
12431266    let  sysroot_opt = matches. opt_str ( "sysroot" ) . map ( |m| PathBuf :: from ( & m) ) ; 
@@ -1315,18 +1338,22 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
13151338    let  cfg = parse_cfgspecs ( matches. opt_strs ( "cfg" ) ) ; 
13161339    let  test = matches. opt_present ( "test" ) ; 
13171340
1318-     let   prints =  matches. opt_strs ( "print" ) . into_iter ( ) . map ( |s| { 
1341+     prints. extend ( matches. opt_strs ( "print" ) . into_iter ( ) . map ( |s| { 
13191342        match  & * s { 
13201343            "crate-name"  => PrintRequest :: CrateName , 
13211344            "file-names"  => PrintRequest :: FileNames , 
13221345            "sysroot"  => PrintRequest :: Sysroot , 
13231346            "cfg"  => PrintRequest :: Cfg , 
13241347            "target-list"  => PrintRequest :: TargetList , 
1348+             "target-cpus"  => PrintRequest :: TargetCPUs , 
1349+             "target-features"  => PrintRequest :: TargetFeatures , 
1350+             "relocation-models"  => PrintRequest :: RelocationModels , 
1351+             "code-models"  => PrintRequest :: CodeModels , 
13251352            req => { 
13261353                early_error ( error_format,  & format ! ( "unknown print request `{}`" ,  req) ) 
13271354            } 
13281355        } 
1329-     } ) . collect :: < Vec < _ > > ( ) ; 
1356+     } ) ) ; 
13301357
13311358    if  !cg. remark . is_empty ( )  && debuginfo == NoDebugInfo  { 
13321359        early_warn ( error_format,  "-C remark will not show source locations without \  
0 commit comments