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
1 changed files with 3 additions and 5 deletions
|
@ -341,14 +341,12 @@ extern "C" void LLVMRustRemoveFunctionAttributes(LLVMValueRef Fn,
|
||||||
unsigned Index,
|
unsigned Index,
|
||||||
LLVMRustAttribute RustAttr) {
|
LLVMRustAttribute RustAttr) {
|
||||||
Function *F = unwrap<Function>(Fn);
|
Function *F = unwrap<Function>(Fn);
|
||||||
Attribute Attr = Attribute::get(F->getContext(), fromRust(RustAttr));
|
AttributeList PAL = F->getAttributes();
|
||||||
AttrBuilder B(Attr);
|
|
||||||
auto PAL = F->getAttributes();
|
|
||||||
AttributeList PALNew;
|
AttributeList PALNew;
|
||||||
#if LLVM_VERSION_LT(14, 0)
|
#if LLVM_VERSION_LT(14, 0)
|
||||||
PALNew = PAL.removeAttributes(F->getContext(), Index, B);
|
PALNew = PAL.removeAttribute(F->getContext(), Index, fromRust(RustAttr));
|
||||||
#else
|
#else
|
||||||
PALNew = PAL.removeAttributesAtIndex(F->getContext(), Index, B);
|
PALNew = PAL.removeAttributeAtIndex(F->getContext(), Index, fromRust(RustAttr));
|
||||||
#endif
|
#endif
|
||||||
F->setAttributes(PALNew);
|
F->setAttributes(PALNew);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue