diff options
| author | Ralf Jung <post@ralfj.de> | 2023-05-10 08:31:30 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2023-05-10 08:31:30 +0200 |
| commit | efa68d02d2ee74f7b70703caef44ff53b92fe910 (patch) | |
| tree | 082e0bc9195c513423a06ef48bb1825f2c2feb97 /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | 53801d3f085f8b635f0e0f668584c1d618cb1d9d (diff) | |
| parent | 65dfca8488d635552eb246eb8e15df646e987cff (diff) | |
| download | rust-efa68d02d2ee74f7b70703caef44ff53b92fe910.tar.gz rust-efa68d02d2ee74f7b70703caef44ff53b92fe910.zip | |
Merge from rustc
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 2fd6db8cbfe..4d0bcd53d15 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -985,13 +985,20 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { fn cleanup_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? */); + let landing_pad = self.landing_pad(ty, pers_fn, 0); unsafe { llvm::LLVMSetCleanup(landing_pad, llvm::True); } (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); + 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); |
