Remove dead instructions in terminate blocks

This commit is contained in:
Mark Rousskov
2025-06-22 11:38:25 -04:00
parent d4e1159b8c
commit a46ef2d01e
3 changed files with 4 additions and 5 deletions

View File

@@ -1591,9 +1591,9 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
(value1, value2)
}
fn filter_landing_pad(&mut self, pers_fn: RValue<'gcc>) -> (RValue<'gcc>, RValue<'gcc>) {
fn filter_landing_pad(&mut self, pers_fn: RValue<'gcc>) {
// TODO(antoyo): generate the correct landing pad
self.cleanup_landing_pad(pers_fn)
self.cleanup_landing_pad(pers_fn);
}
#[cfg(feature = "master")]

View File

@@ -1166,11 +1166,10 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
(self.extract_value(landing_pad, 0), self.extract_value(landing_pad, 1))
}
fn filter_landing_pad(&mut self, pers_fn: &'ll Value) -> (&'ll Value, &'ll Value) {
fn filter_landing_pad(&mut self, pers_fn: &'ll Value) {
let ty = self.type_struct(&[self.type_ptr(), self.type_i32()], false);
let landing_pad = self.landing_pad(ty, pers_fn, 1);
self.add_clause(landing_pad, self.const_array(self.type_ptr(), &[]));
(self.extract_value(landing_pad, 0), self.extract_value(landing_pad, 1))
}
fn resume(&mut self, exn0: &'ll Value, exn1: &'ll Value) {

View File

@@ -516,7 +516,7 @@ pub trait BuilderMethods<'a, 'tcx>:
// These are used by everyone except msvc
fn cleanup_landing_pad(&mut self, pers_fn: Self::Function) -> (Self::Value, Self::Value);
fn filter_landing_pad(&mut self, pers_fn: Self::Function) -> (Self::Value, Self::Value);
fn filter_landing_pad(&mut self, pers_fn: Self::Function);
fn resume(&mut self, exn0: Self::Value, exn1: Self::Value);
// These are used only by msvc