Skip to content

Commit 1591dcb

Browse files
authored
Rollup merge of #92559 - durin42:llvm-14-attributemask, r=nikic
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. r? ``@nagisa`` cc ``@nikic``
2 parents 844a657 + 34a6b6c commit 1591dcb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp

+3-5
Original file line numberDiff line numberDiff line change
@@ -341,14 +341,12 @@ extern "C" void LLVMRustRemoveFunctionAttributes(LLVMValueRef Fn,
341341
unsigned Index,
342342
LLVMRustAttribute RustAttr) {
343343
Function *F = unwrap<Function>(Fn);
344-
Attribute Attr = Attribute::get(F->getContext(), fromRust(RustAttr));
345-
AttrBuilder B(Attr);
346-
auto PAL = F->getAttributes();
344+
AttributeList PAL = F->getAttributes();
347345
AttributeList PALNew;
348346
#if LLVM_VERSION_LT(14, 0)
349-
PALNew = PAL.removeAttributes(F->getContext(), Index, B);
347+
PALNew = PAL.removeAttribute(F->getContext(), Index, fromRust(RustAttr));
350348
#else
351-
PALNew = PAL.removeAttributesAtIndex(F->getContext(), Index, B);
349+
PALNew = PAL.removeAttributeAtIndex(F->getContext(), Index, fromRust(RustAttr));
352350
#endif
353351
F->setAttributes(PALNew);
354352
}

0 commit comments

Comments
 (0)