diff options
| author | Nikita Popov <npopov@redhat.com> | 2023-03-16 14:56:02 +0100 |
|---|---|---|
| committer | Nikita Popov <npopov@redhat.com> | 2023-03-16 15:07:04 +0100 |
| commit | 30331828cb9e694b59c9325dce7c1f25dac3e80e (patch) | |
| tree | d55723b741ac33fd7468442329d29ddc019f3c9c /compiler/rustc_codegen_llvm/src/builder.rs | |
| parent | cd6c574af3886c41f34086d90df42c3da0144693 (diff) | |
| download | rust-30331828cb9e694b59c9325dce7c1f25dac3e80e.tar.gz rust-30331828cb9e694b59c9325dce7c1f25dac3e80e.zip | |
Use poison instead of undef
In cases where it is legal, we should prefer poison values over undef values. This replaces undef with poison for aggregate construction and for uninhabited types. There are more places where we can likely use poison, but I wanted to stay conservative to start with. In particular the aggregate case is important for newer LLVM versions, which are not able to handle an undef base value during early optimization due to poison-propagation concerns.
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/builder.rs')
| -rw-r--r-- | compiler/rustc_codegen_llvm/src/builder.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_llvm/src/builder.rs b/compiler/rustc_codegen_llvm/src/builder.rs index 0f33b985489..580451ba265 100644 --- a/compiler/rustc_codegen_llvm/src/builder.rs +++ b/compiler/rustc_codegen_llvm/src/builder.rs @@ -990,7 +990,7 @@ impl<'a, 'll, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { 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_undef(ty); + let mut exn = self.const_poison(ty); exn = self.insert_value(exn, exn0, 0); exn = self.insert_value(exn, exn1, 1); unsafe { |
