From 70b600b0a2ad3c787091f41df89f532dc782511e Mon Sep 17 00:00:00 2001 From: Troels Nielsen Date: Wed, 25 Aug 2021 01:18:47 +0200 Subject: [PATCH] Use setAttributes instead of addAttributes/removeAttributes Co-authored-by: Jameson Nash --- src/codegen.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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);