[llvm] [LLVM][Support] add nonNull function helper (PR #188718)
Nathan Gauër via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 26 08:49:57 PDT 2026
================
@@ -811,6 +811,19 @@ T cantFail(Expected<T> ValOrErr, const char *Msg = nullptr) {
}
}
+/// Calls llvm_unreachable if Pointer is null, otherwise returns the
+/// pointer as is.
+template <typename T>
+LLVM_ATTRIBUTE_RETURNS_NONNULL T *nonNull(T *Pointer,
----------------
Keenuts wrote:
Done, thanks!
https://github.com/llvm/llvm-project/pull/188718
More information about the llvm-commits
mailing list