@@ -5,7 +5,6 @@ pub(super) struct GccExceptTable {
55 pub call_sites : CallSiteTable ,
66 pub actions : ActionTable ,
77 pub type_info : TypeInfoTable ,
8- pub exception_specs : ExceptionSpecTable ,
98}
109
1110impl GccExceptTable {
@@ -80,8 +79,7 @@ impl GccExceptTable {
8079 // type_info
8180 self . type_info . write ( w, encoding) ?;
8281
83- // exception specs
84- self . exception_specs . write ( w) ?;
82+ // exception specs (unused for rust)
8583
8684 // align to 4 bytes
8785 while w. len ( ) % 4 != 0 {
@@ -194,11 +192,7 @@ impl Action {
194192 fn write < W : Writer > ( & self , w : & mut W , action_table_offset : u64 ) -> gimli:: write:: Result < ( ) > {
195193 // ttypeIndex
196194 let ttype_index = match self . kind {
197- ActionKind :: Cleanup => 0 ,
198195 ActionKind :: Catch ( type_info_id) => type_info_id. 0 as i64 + 1 ,
199- ActionKind :: ExceptionSpec ( exception_spec_offset) => {
200- -( exception_spec_offset. 0 as i64 + 1 )
201- }
202196 } ;
203197 w. write_sleb128 ( ttype_index) ?;
204198 // actionOffset
@@ -215,12 +209,8 @@ impl Action {
215209}
216210
217211#[ derive( Copy , Clone ) ]
218- #[ expect( dead_code) ]
219212pub ( super ) enum ActionKind {
220- Cleanup ,
221213 Catch ( TypeInfoId ) ,
222- // FIXME
223- ExceptionSpec ( ExceptionSpecOffset ) ,
224214}
225215
226216pub ( super ) struct TypeInfoTable {
@@ -257,53 +247,6 @@ impl TypeInfoTable {
257247#[ derive( Copy , Clone ) ]
258248pub ( super ) struct TypeInfoId ( u64 ) ;
259249
260- pub ( super ) struct ExceptionSpecTable {
261- specs : Vec < ExceptionSpec > ,
262- encoded_length : u64 ,
263- }
264-
265- impl ExceptionSpecTable {
266- pub ( super ) fn new ( ) -> ExceptionSpecTable {
267- ExceptionSpecTable { specs : vec ! [ ] , encoded_length : 0 }
268- }
269-
270- #[ expect( dead_code) ] // FIXME
271- pub ( super ) fn add ( & mut self , exception_spec : ExceptionSpec ) -> ExceptionSpecOffset {
272- let id = ExceptionSpecOffset ( self . encoded_length ) ;
273- self . encoded_length += exception_spec. encoded_size ( ) ;
274- self . specs . push ( exception_spec) ;
275- id
276- }
277-
278- fn write < W : Writer > ( & self , w : & mut W ) -> gimli:: write:: Result < ( ) > {
279- for exception_spec in & self . specs {
280- exception_spec. write ( w) ?;
281- }
282-
283- Ok ( ( ) )
284- }
285- }
286-
287- #[ derive( Copy , Clone ) ]
288- pub ( super ) struct ExceptionSpecOffset ( u64 ) ;
289-
290- pub ( super ) struct ExceptionSpec ( pub Vec < TypeInfoId > ) ;
291-
292- impl ExceptionSpec {
293- fn encoded_size ( & self ) -> u64 {
294- let mut len = LenWriter ( 0 ) ;
295- self . write ( & mut len) . unwrap ( ) ;
296- len. 0 as u64
297- }
298-
299- fn write < W : Writer > ( & self , w : & mut W ) -> gimli:: write:: Result < ( ) > {
300- for type_info_id in & self . 0 {
301- w. write_uleb128 ( type_info_id. 0 + 1 ) ?;
302- }
303- w. write_u8 ( 0 )
304- }
305- }
306-
307250struct LenWriter ( usize ) ;
308251
309252impl Writer for LenWriter {
0 commit comments