diff options
| author | Gary Guo <gary@garyguo.net> | 2022-11-06 21:24:20 +0000 |
|---|---|---|
| committer | Gary Guo <gary@garyguo.net> | 2023-05-07 12:35:54 +0100 |
| commit | 47171e0c500e791280e269a73c382bfac15148b2 (patch) | |
| tree | 65e052089fd16288eea113b5d4d35c0d976a73f3 /compiler/rustc_codegen_llvm/src | |
| parent | 8660707bb22b2fa0ef6e2d37c60da20d9cf3d7b9 (diff) | |
| download | rust-47171e0c500e791280e269a73c382bfac15148b2.tar.gz rust-47171e0c500e791280e269a73c382bfac15148b2.zip | |
Use `landingpad filter` to encode aborting landing pad
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 2fd6db8cbfe..10da8cc4c25 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -992,6 +992,13 @@ 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) { + let ty = self.type_struct(&[self.type_i8p(), self.type_i32()], false); + let landing_pad = self.landing_pad(ty, pers_fn, 1 /* FIXME should this be 0? */); + self.add_clause(landing_pad, self.const_array(self.type_i8p(), &[])); + (self.extract_value(landing_pad, 0), self.extract_value(landing_pad, 1)) + } + fn resume(&mut self, exn0: &'ll Value, exn1: &'ll Value) { let ty = self.type_struct(&[self.type_i8p(), self.type_i32()], false); let mut exn = self.const_poison(ty); |
