about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorErik Desjardins <erikdesjardins@users.noreply.github.com>2022-02-05 01:00:37 -0500
committerErik Desjardins <erikdesjardins@users.noreply.github.com>2022-02-05 01:09:52 -0500
commit8cb0b6ca5bf1321d38f4602113b0f41c837d0586 (patch)
treeceb48b535511ea78faaa617e20cdef30f20ff4b9 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent71226d717a1fb57122e47e63b97295e703319cb0 (diff)
downloadrust-8cb0b6ca5bf1321d38f4602113b0f41c837d0586.tar.gz
rust-8cb0b6ca5bf1321d38f4602113b0f41c837d0586.zip
Apply noundef attribute to &T, &mut T, Box<T>, bool
This doesn't handle `char` because it's a bit awkward to distinguish it
from u32 at this point in codegen.

Note that for some types (like `&Struct` and `&mut Struct`),
we already apply `dereferenceable`, which implies `noundef`,
so the IR does not change.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
-rw-r--r--compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
index d871290744f..fb9c5e6a527 100644
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
@@ -224,6 +224,8 @@ static Attribute::AttrKind fromRust(LLVMRustAttribute Kind) {
     return Attribute::StackProtectStrong;
   case StackProtect:
     return Attribute::StackProtect;
+  case NoUndef:
+    return Attribute::NoUndef;
   }
   report_fatal_error("bad AttributeKind");
 }