Rollup merge of #92559 - durin42:llvm-14-attributemask, r=nikic
RustWrapper: adapt to new AttributeMask API Upstream LLVM change 9290ccc3c1a1 migrated attribute removal to use AttributeMask instead of AttrBuilder, so we need to follow suit here. r? ``@nagisa`` cc ``@nikic``
This commit is contained in:
commit
1591dcb659
@ -341,14 +341,12 @@ extern "C" void LLVMRustRemoveFunctionAttributes(LLVMValueRef Fn,
|
||||
unsigned Index,
|
||||
LLVMRustAttribute RustAttr) {
|
||||
Function *F = unwrap<Function>(Fn);
|
||||
Attribute Attr = Attribute::get(F->getContext(), fromRust(RustAttr));
|
||||
AttrBuilder B(Attr);
|
||||
auto PAL = F->getAttributes();
|
||||
AttributeList PAL = F->getAttributes();
|
||||
AttributeList PALNew;
|
||||
#if LLVM_VERSION_LT(14, 0)
|
||||
PALNew = PAL.removeAttributes(F->getContext(), Index, B);
|
||||
PALNew = PAL.removeAttribute(F->getContext(), Index, fromRust(RustAttr));
|
||||
#else
|
||||
PALNew = PAL.removeAttributesAtIndex(F->getContext(), Index, B);
|
||||
PALNew = PAL.removeAttributeAtIndex(F->getContext(), Index, fromRust(RustAttr));
|
||||
#endif
|
||||
F->setAttributes(PALNew);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user