Add align attribute for params pointers
This commit is contained in:
parent
74d9593d85
commit
7d762648a4
|
@ -2280,6 +2280,9 @@ void walk_function_params(CodeGen *g, ZigType *fn_type, FnWalk *fn_walk) {
|
|||
if ((param_type->id == ZigTypeIdPointer && param_type->data.pointer.is_const) || is_byval) {
|
||||
addLLVMArgAttr(llvm_fn, (unsigned)gen_index, "readonly");
|
||||
}
|
||||
if (get_codegen_ptr_type(param_type) != nullptr) {
|
||||
addLLVMArgAttrInt(llvm_fn, (unsigned)gen_index, "align", get_ptr_align(g, param_type));
|
||||
}
|
||||
if (type_is_nonnull_ptr(param_type)) {
|
||||
addLLVMArgAttr(llvm_fn, (unsigned)gen_index, "nonnull");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user