mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
llvm: Don't set nonnull attribute on allowzero slices.
This commit is contained in:
parent
e95e7651ec
commit
e9ae9a5fc4
@ -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…
x
Reference in New Issue
Block a user