diff --git a/src/codegen.cpp b/src/codegen.cpp index 37540584e7996..251e35a37f438 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -5180,11 +5180,10 @@ static Function* gen_cfun_wrapper( // Skip past function and return and sret attributes to the first real parameter for (auto it = attributes.index_begin() + 2 + sig.sret; it != attributes.index_end(); ++it) { AttrBuilder toShiftTemp(attributes.getAttributes(it)); - attributes = attributes.removeAttributes(jl_LLVMContext, it); - attributes = attributes.addAttributes(jl_LLVMContext, it, toShift); + attributes = attributes.setAttributes(jl_LLVMContext, it, toShift); toShift = std::move(toShiftTemp); } - attributes = attributes.addAttributes(jl_LLVMContext, attributes.index_end(), toShift); + attributes = attributes.setAttributes(jl_LLVMContext, attributes.index_end(), toShift); } functype = FunctionType::get(sig.sret ? T_void : sig.prt, fargt_sig, /*isVa*/false);