mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
llvm: Don't set nonnull attribute on allowzero slices.
This commit is contained in:
parent
e95e7651ec
commit
e9ae9a5fc4
1 changed files with 2 additions and 2 deletions
|
|
@ -1341,7 +1341,7 @@ pub const Object = struct {
|
|||
try attributes.addParamAttr(llvm_arg_i, .@"noalias", &o.builder);
|
||||
}
|
||||
}
|
||||
if (param_ty.zigTypeTag(zcu) != .optional) {
|
||||
if (param_ty.zigTypeTag(zcu) != .optional and !ptr_info.flags.is_allowzero) {
|
||||
try attributes.addParamAttr(llvm_arg_i, .nonnull, &o.builder);
|
||||
}
|
||||
if (ptr_info.flags.is_const) {
|
||||
|
|
@ -5410,7 +5410,7 @@ pub const FuncGen = struct {
|
|||
try attributes.addParamAttr(llvm_arg_i, .@"noalias", &o.builder);
|
||||
}
|
||||
}
|
||||
if (param_ty.zigTypeTag(zcu) != .optional) {
|
||||
if (param_ty.zigTypeTag(zcu) != .optional and !ptr_info.flags.is_allowzero) {
|
||||
try attributes.addParamAttr(llvm_arg_i, .nonnull, &o.builder);
|
||||
}
|
||||
if (ptr_info.flags.is_const) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue