Skip to content

Commit 2803fbc

Browse files
committed
RustWrapper: adapt to new AttributeMask API
Upstream LLVM change 9290ccc migrated attribute removal to use AttributeMask instead of AttrBuilder, so we need to follow suit here.
1 parent 2b681ac commit 2803fbc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,15 @@ extern "C" void LLVMRustRemoveFunctionAttributes(LLVMValueRef Fn,
342342
LLVMRustAttribute RustAttr) {
343343
Function *F = unwrap<Function>(Fn);
344344
Attribute Attr = Attribute::get(F->getContext(), fromRust(RustAttr));
345-
AttrBuilder B(Attr);
346345
auto PAL = F->getAttributes();
347346
AttributeList PALNew;
348347
#if LLVM_VERSION_LT(14, 0)
348+
AttrBuilder B(Attr);
349349
PALNew = PAL.removeAttributes(F->getContext(), Index, B);
350350
#else
351-
PALNew = PAL.removeAttributesAtIndex(F->getContext(), Index, B);
351+
AttributeMask M;
352+
M.addAttribute(Attr);
353+
PALNew = PAL.removeAttributesAtIndex(F->getContext(), Index, M);
352354
#endif
353355
F->setAttributes(PALNew);
354356
}

0 commit comments

Comments
 (0)