@@ -5,6 +5,8 @@ use crate::ir::values::InstMatcherValue;
55use crate :: matchers:: exception:: InvokeInstMatcher ;
66use crate :: matchers:: exception:: LandingPadInstMatcher ;
77use crate :: matchers:: exception:: ResumeInstMatcher ;
8+ use crate :: matchers:: exception:: RethrowInstMatcher ;
9+ use crate :: matchers:: exception:: ThrowInstMatcher ;
810
911use gitql_core:: signature:: Signature ;
1012use gitql_core:: signature:: StandardFunction ;
@@ -17,6 +19,8 @@ pub fn register_exception_inst_matchers_functions(
1719 map. insert ( "m_invoke" , match_invoke_inst) ;
1820 map. insert ( "m_landingpad" , match_landingpad_inst) ;
1921 map. insert ( "m_resume" , match_resume_inst) ;
22+ map. insert ( "m_throw" , match_throw_inst) ;
23+ map. insert ( "m_rethrow" , match_rethrow_inst) ;
2024}
2125
2226#[ inline( always) ]
@@ -46,6 +50,22 @@ pub fn register_exception_inst_matchers_function_signatures(
4650 return_type : Box :: new ( InstMatcherType ) ,
4751 } ,
4852 ) ;
53+
54+ map. insert (
55+ "m_throw" ,
56+ Signature {
57+ parameters : vec ! [ ] ,
58+ return_type : Box :: new ( InstMatcherType ) ,
59+ } ,
60+ ) ;
61+
62+ map. insert (
63+ "m_rethrow" ,
64+ Signature {
65+ parameters : vec ! [ ] ,
66+ return_type : Box :: new ( InstMatcherType ) ,
67+ } ,
68+ ) ;
4969}
5070
5171fn match_invoke_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
@@ -62,3 +82,13 @@ fn match_resume_inst(_values: &[Box<dyn Value>]) -> Box<dyn Value> {
6282 let matcher = Box :: new ( ResumeInstMatcher ) ;
6383 Box :: new ( InstMatcherValue { matcher } )
6484}
85+
86+ fn match_throw_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
87+ let matcher = Box :: new ( ThrowInstMatcher ) ;
88+ Box :: new ( InstMatcherValue { matcher } )
89+ }
90+
91+ fn match_rethrow_inst ( _values : & [ Box < dyn Value > ] ) -> Box < dyn Value > {
92+ let matcher = Box :: new ( RethrowInstMatcher ) ;
93+ Box :: new ( InstMatcherValue { matcher } )
94+ }
0 commit comments