@@ -10,10 +10,12 @@ use crate::ir::types::InstMatcherType;
1010use crate :: ir:: values:: InstMatcherValue ;
1111use crate :: matchers:: constants:: ConstFloatMatcher ;
1212use crate :: matchers:: constants:: ConstIntMatcher ;
13+ use crate :: matchers:: constants:: ConstNumberMatcher ;
1314use crate :: matchers:: constants:: ConstPointerNullMatcher ;
1415
1516#[ inline( always) ]
1617pub fn register_constants_matchers_functions ( map : & mut HashMap < & ' static str , StandardFunction > ) {
18+ map. insert ( "m_const_num" , match_const_num_inst) ;
1719 map. insert ( "m_const_int" , match_const_int_inst) ;
1820 map. insert ( "m_zero" , match_const_zero_inst) ;
1921 map. insert ( "m_one" , match_const_one_inst) ;
@@ -27,6 +29,7 @@ pub fn register_constants_matchers_functions(map: &mut HashMap<&'static str, Sta
2729
2830#[ inline( always) ]
2931pub fn register_constants_matchers_function_signatures ( map : & mut HashMap < & ' static str , Signature > ) {
32+ map. insert ( "m_const_num" , matcher_signature_without_parameters ( ) ) ;
3033 map. insert ( "m_const_int" , matcher_signature_without_parameters ( ) ) ;
3134 map. insert ( "m_zero" , matcher_signature_without_parameters ( ) ) ;
3235 map. insert ( "m_one" , matcher_signature_without_parameters ( ) ) ;
@@ -51,6 +54,11 @@ pub fn register_constants_matchers_function_signatures(map: &mut HashMap<&'stati
5154 map. insert ( "m_const_null" , matcher_signature_without_parameters ( ) ) ;
5255}
5356
57+ fn match_const_num_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
58+ let matcher = Box :: new ( ConstNumberMatcher ) ;
59+ Box :: new ( InstMatcherValue { matcher } )
60+ }
61+
5462fn match_const_int_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
5563 let matcher = Box :: new ( ConstIntMatcher :: create_const_int ( ) ) ;
5664 Box :: new ( InstMatcherValue { matcher } )
0 commit comments