| ... | ... | @@ -326,13 +326,6 @@ static void addLLVMArgAttr(LLVMValueRef arg_val, unsigned param_index, const cha |
| 326 | 326 | return addLLVMAttr(arg_val, param_index + 1, attr_name); |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | | static void addLLVMCallsiteAttr(LLVMValueRef call_instr, unsigned param_index, const char *attr_name) { |
| 330 | | unsigned kind_id = LLVMGetEnumAttributeKindForName(attr_name, strlen(attr_name)); |
| 331 | | assert(kind_id != 0); |
| 332 | | LLVMAttributeRef llvm_attr = LLVMCreateEnumAttribute(LLVMGetGlobalContext(), kind_id, 0); |
| 333 | | LLVMAddCallSiteAttribute(call_instr, param_index + 1, llvm_attr); |
| 334 | | } |
| 335 | | |
| 336 | 329 | static bool is_symbol_available(CodeGen *g, Buf *name) { |
| 337 | 330 | return g->exported_symbol_names.maybe_get(name) == nullptr && g->external_prototypes.maybe_get(name) == nullptr; |
| 338 | 331 | } |
| ... | ... | @@ -581,11 +574,6 @@ static LLVMValueRef fn_llvm_value(CodeGen *g, FnTableEntry *fn_table_entry) { |
| 581 | 574 | if (param_type->id == TypeTableEntryIdPointer) { |
| 582 | 575 | addLLVMArgAttr(fn_table_entry->llvm_value, (unsigned)gen_index, "nonnull"); |
| 583 | 576 | } |
| 584 | | // Note: byval is disabled on windows due to an LLVM bug: |
| 585 | | // https://github.com/ziglang/zig/issues/536 |
| 586 | | if (is_byval && g->zig_target.os != OsWindows) { |
| 587 | | addLLVMArgAttr(fn_table_entry->llvm_value, (unsigned)gen_index, "byval"); |
| 588 | | } |
| 589 | 577 | } |
| 590 | 578 | |
| 591 | 579 | uint32_t err_ret_trace_arg_index = get_err_ret_trace_arg_index(g, fn_table_entry); |
| ... | ... | @@ -3114,15 +3102,6 @@ static LLVMValueRef ir_render_call(CodeGen *g, IrExecutable *executable, IrInstr |
| 3114 | 3102 | } |
| 3115 | 3103 | |
| 3116 | 3104 | |
| 3117 | | for (size_t param_i = 0; param_i < fn_type_id->param_count; param_i += 1) { |
| 3118 | | FnGenParamInfo *gen_info = &fn_type->data.fn.gen_param_info[param_i]; |
| 3119 | | // Note: byval is disabled on windows due to an LLVM bug: |
| 3120 | | // https://github.com/ziglang/zig/issues/536 |
| 3121 | | if (gen_info->is_byval && g->zig_target.os != OsWindows) { |
| 3122 | | addLLVMCallsiteAttr(result, (unsigned)gen_info->gen_index, "byval"); |
| 3123 | | } |
| 3124 | | } |
| 3125 | | |
| 3126 | 3105 | if (instruction->is_async) { |
| 3127 | 3106 | LLVMValueRef payload_ptr = LLVMBuildStructGEP(g->builder, instruction->tmp_ptr, err_union_payload_index, ""); |
| 3128 | 3107 | LLVMBuildStore(g->builder, result, payload_ptr); |