@@ -765,7 +765,16 @@ pub fn version(binary: &str, matches: &getopts::Matches) {
765
765
println ! ( "commit-date: {}" , unw( util:: commit_date_str( ) ) ) ;
766
766
println ! ( "host: {}" , config:: host_triple( ) ) ;
767
767
println ! ( "release: {}" , unw( util:: release_str( ) ) ) ;
768
- get_codegen_backend ( & None , None ) . print_version ( ) ;
768
+
769
+ let debug_flags = matches. opt_strs ( "Z" ) ;
770
+ let backend_name = debug_flags. iter ( ) . find_map ( |x| {
771
+ if x. starts_with ( "codegen-backend=" ) {
772
+ Some ( & x[ "codegen-backends=" . len ( ) ..] )
773
+ } else {
774
+ None
775
+ }
776
+ } ) ;
777
+ get_codegen_backend ( & None , backend_name) . print_version ( ) ;
769
778
}
770
779
}
771
780
@@ -1037,8 +1046,8 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
1037
1046
}
1038
1047
1039
1048
// Don't handle -W help here, because we might first load plugins.
1040
- let r = matches. opt_strs ( "Z" ) ;
1041
- if r . iter ( ) . any ( |x| * x == "help" ) {
1049
+ let debug_flags = matches. opt_strs ( "Z" ) ;
1050
+ if debug_flags . iter ( ) . any ( |x| * x == "help" ) {
1042
1051
describe_debug_flags ( ) ;
1043
1052
return None ;
1044
1053
}
@@ -1058,7 +1067,10 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
1058
1067
}
1059
1068
1060
1069
if cg_flags. iter ( ) . any ( |x| * x == "passes=list" ) {
1061
- get_codegen_backend ( & None , None ) . print_passes ( ) ;
1070
+ let backend_name = debug_flags. iter ( ) . find_map ( |x| {
1071
+ if x. starts_with ( "codegen-backend=" ) { Some ( & x[ "codegen-backends=" . len ( ) ..] ) } else { None }
1072
+ } ) ;
1073
+ get_codegen_backend ( & None , backend_name) . print_passes ( ) ;
1062
1074
return None ;
1063
1075
}
1064
1076
0 commit comments