always give the type to byval attribute
This commit is contained in:
@@ -723,6 +723,16 @@ void ZigLLVMSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state) {
|
||||
}
|
||||
}
|
||||
|
||||
void ZigLLVMAddByValAttr(LLVMValueRef fn_ref, unsigned ArgNo, LLVMTypeRef type_val) {
|
||||
Function *func = unwrap<Function>(fn_ref);
|
||||
const AttributeList attr_set = func->getAttributes();
|
||||
AttrBuilder attr_builder;
|
||||
Type *llvm_type = unwrap<Type>(type_val);
|
||||
attr_builder.addByValAttr(llvm_type);
|
||||
const AttributeList new_attr_set = attr_set.addAttributes(func->getContext(), ArgNo, attr_builder);
|
||||
func->setAttributes(new_attr_set);
|
||||
}
|
||||
|
||||
void ZigLLVMAddFunctionAttr(LLVMValueRef fn_ref, const char *attr_name, const char *attr_value) {
|
||||
Function *func = unwrap<Function>(fn_ref);
|
||||
const AttributeList attr_set = func->getAttributes();
|
||||
|
||||
Reference in New Issue
Block a user