@@ -3,6 +3,8 @@ use std::collections::HashMap;
33use crate :: ir:: types:: InstMatcherType ;
44use crate :: ir:: values:: InstMatcherValue ;
55use crate :: matchers:: exception:: AllocaExceptionInstMatcher ;
6+ use crate :: matchers:: exception:: CatchBeginInstMatcher ;
7+ use crate :: matchers:: exception:: CatchEndInstMatcher ;
68use crate :: matchers:: exception:: EHTypeIdInstMatcher ;
79use crate :: matchers:: exception:: FreeExceptionInstMatcher ;
810use crate :: matchers:: exception:: InvokeInstMatcher ;
@@ -27,6 +29,8 @@ pub fn register_exception_inst_matchers_functions(
2729 map. insert ( "m_eh_typeid" , match_eh_typeid_inst) ;
2830 map. insert ( "m_alloca_exception" , match_alloca_exception_inst) ;
2931 map. insert ( "m_free_exception" , match_free_exception_inst) ;
32+ map. insert ( "m_begin_catch" , match_begin_catch_inst) ;
33+ map. insert ( "m_end_catch" , match_end_catch_inst) ;
3034}
3135
3236#[ inline( always) ]
@@ -96,6 +100,22 @@ pub fn register_exception_inst_matchers_function_signatures(
96100 return_type : Box :: new ( InstMatcherType ) ,
97101 } ,
98102 ) ;
103+
104+ map. insert (
105+ "m_begin_catch" ,
106+ Signature {
107+ parameters : vec ! [ ] ,
108+ return_type : Box :: new ( InstMatcherType ) ,
109+ } ,
110+ ) ;
111+
112+ map. insert (
113+ "m_end_catch" ,
114+ Signature {
115+ parameters : vec ! [ ] ,
116+ return_type : Box :: new ( InstMatcherType ) ,
117+ } ,
118+ ) ;
99119}
100120
101121fn match_invoke_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
@@ -137,3 +157,13 @@ fn match_free_exception_inst(_values: &[Box<dyn Value>]) -> Box<dyn Value> {
137157 let matcher = Box :: new ( FreeExceptionInstMatcher ) ;
138158 Box :: new ( InstMatcherValue { matcher } )
139159}
160+
161+ fn match_begin_catch_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
162+ let matcher = Box :: new ( CatchBeginInstMatcher ) ;
163+ Box :: new ( InstMatcherValue { matcher } )
164+ }
165+
166+ fn match_end_catch_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
167+ let matcher = Box :: new ( CatchEndInstMatcher ) ;
168+ Box :: new ( InstMatcherValue { matcher } )
169+ }
0 commit comments