stage1: Fix emission of sret annotation for LLVM
LLVM12 deprecated `sret` and replaced it with the `sret(<Ty>)` form. Closes #8075
This commit is contained in:
@@ -798,7 +798,17 @@ void ZigLLVMAddByValAttr(LLVMValueRef fn_ref, unsigned ArgNo, LLVMTypeRef type_v
|
||||
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);
|
||||
const AttributeList new_attr_set = attr_set.addAttributes(func->getContext(), ArgNo + 1, attr_builder);
|
||||
func->setAttributes(new_attr_set);
|
||||
}
|
||||
|
||||
void ZigLLVMAddSretAttr(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.addStructRetAttr(llvm_type);
|
||||
const AttributeList new_attr_set = attr_set.addAttributes(func->getContext(), ArgNo + 1, attr_builder);
|
||||
func->setAttributes(new_attr_set);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user