@@ -52,30 +52,6 @@ macro_rules! def_reg_class {
52
52
53
53
#[ macro_use]
54
54
macro_rules! def_regs {
55
- ( $arch: ident $arch_reg: ident $arch_regclass: ident { } ) => {
56
- #[ allow( unreachable_code) ]
57
- #[ derive( Copy , Clone , RustcEncodable , RustcDecodable , Debug , Eq , PartialEq , Hash , HashStable_Generic ) ]
58
- pub enum $arch_reg { }
59
-
60
- impl $arch_reg {
61
- pub fn parse(
62
- _arch: super :: InlineAsmArch ,
63
- mut _has_feature: impl FnMut ( & str ) -> bool ,
64
- _name: & str ,
65
- ) -> Result <Self , & ' static str > {
66
- Err ( "unknown register" )
67
- }
68
- }
69
-
70
- pub ( super ) fn fill_reg_map(
71
- _arch: super :: InlineAsmArch ,
72
- mut _has_feature: impl FnMut ( & str ) -> bool ,
73
- _map: & mut rustc_data_structures:: fx:: FxHashMap <
74
- super :: InlineAsmRegClass ,
75
- rustc_data_structures:: fx:: FxHashSet <super :: InlineAsmReg >,
76
- >,
77
- ) { }
78
- } ;
79
55
( $arch: ident $arch_reg: ident $arch_regclass: ident {
80
56
$(
81
57
$reg: ident: $class: ident $( , $extra_class: ident) * = [ $reg_name: literal $( , $alias: literal) * ] $( % $filter: ident) ?,
@@ -84,6 +60,7 @@ macro_rules! def_regs {
84
60
#error = [ $( $bad_reg: literal) ,+] => $error: literal,
85
61
) *
86
62
} ) => {
63
+ #[ allow( unreachable_code) ]
87
64
#[ derive( Copy , Clone , RustcEncodable , RustcDecodable , Debug , Eq , PartialEq , Hash , HashStable_Generic ) ]
88
65
#[ allow( non_camel_case_types) ]
89
66
pub enum $arch_reg {
@@ -126,19 +103,20 @@ macro_rules! def_regs {
126
103
pub ( super ) fn fill_reg_map(
127
104
_arch: super :: InlineAsmArch ,
128
105
mut _has_feature: impl FnMut ( & str ) -> bool ,
129
- map : & mut rustc_data_structures:: fx:: FxHashMap <
106
+ _map : & mut rustc_data_structures:: fx:: FxHashMap <
130
107
super :: InlineAsmRegClass ,
131
108
rustc_data_structures:: fx:: FxHashSet <super :: InlineAsmReg >,
132
109
>,
133
110
) {
111
+ #[ allow( unused_imports) ]
134
112
use super :: { InlineAsmReg , InlineAsmRegClass } ;
135
113
$(
136
114
if $( $filter( _arch, & mut _has_feature, true ) . is_ok( ) &&) ? true {
137
- if let Some ( set) = map . get_mut( & InlineAsmRegClass :: $arch( $arch_regclass:: $class) ) {
115
+ if let Some ( set) = _map . get_mut( & InlineAsmRegClass :: $arch( $arch_regclass:: $class) ) {
138
116
set. insert( InlineAsmReg :: $arch( $arch_reg:: $reg) ) ;
139
117
}
140
118
$(
141
- if let Some ( set) = map . get_mut( & InlineAsmRegClass :: $arch( $arch_regclass:: $extra_class) ) {
119
+ if let Some ( set) = _map . get_mut( & InlineAsmRegClass :: $arch( $arch_regclass:: $extra_class) ) {
142
120
set. insert( InlineAsmReg :: $arch( $arch_reg:: $reg) ) ;
143
121
}
144
122
) *
0 commit comments