mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
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:
1 parent
431801707f
commit
b706b9bce7
3 files changed
+14
-3
No files matched your search
+11
-1
@@ -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