Skip to content

Commit 6ec5ebd

Browse files
committed
Auto merge of rust-lang#105252 - bjorn3:codegen_less_pair_values, r=nagisa
Use struct types during codegen in less places This makes it easier to use cg_ssa from a backend like Cranelift that doesn't have any struct types at all. After this PR struct types are still used for function arguments and return values. Removing those usages is harder but should still be doable.
2 parents 79f7b7b + 213ced1 commit 6ec5ebd

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/builder.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,18 +1119,18 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
11191119
// TODO(antoyo)
11201120
}
11211121

1122-
fn cleanup_landing_pad(&mut self, _ty: Type<'gcc>, _pers_fn: RValue<'gcc>) -> RValue<'gcc> {
1123-
let field1 = self.context.new_field(None, self.u8_type.make_pointer(), "landing_pad_field_1");
1124-
let field2 = self.context.new_field(None, self.i32_type, "landing_pad_field_1");
1125-
let struct_type = self.context.new_struct_type(None, "landing_pad", &[field1, field2]);
1126-
self.current_func().new_local(None, struct_type.as_type(), "landing_pad")
1127-
.to_rvalue()
1122+
fn cleanup_landing_pad(&mut self, _pers_fn: RValue<'gcc>) -> (RValue<'gcc>, RValue<'gcc>) {
1123+
(
1124+
self.current_func().new_local(None, self.u8_type.make_pointer(), "landing_pad0")
1125+
.to_rvalue(),
1126+
self.current_func().new_local(None, self.i32_type, "landing_pad1").to_rvalue(),
1127+
)
11281128
// TODO(antoyo): Properly implement unwinding.
11291129
// the above is just to make the compilation work as it seems
11301130
// rustc_codegen_ssa now calls the unwinding builder methods even on panic=abort.
11311131
}
11321132

1133-
fn resume(&mut self, _exn: RValue<'gcc>) {
1133+
fn resume(&mut self, _exn0: RValue<'gcc>, _exn1: RValue<'gcc>) {
11341134
// TODO(bjorn3): Properly implement unwinding.
11351135
self.unreachable();
11361136
}

0 commit comments

Comments
 (0)