remove noinline attribute and add alwaysinline after AD pass

This commit is contained in:
bit-aloo
2025-04-20 15:54:12 +05:30
parent 9bc04016e6
commit 7018392337
8 changed files with 104 additions and 10 deletions

View File

@@ -979,16 +979,18 @@ LLVMRustRemoveEnumAttributeAtIndex(LLVMValueRef F, size_t index,
LLVMRemoveEnumAttributeAtIndex(F, index, fromRust(RustAttr));
}
extern "C" bool LLVMRustHasFnAttribute(LLVMValueRef F, const char *Name) {
extern "C" bool LLVMRustHasFnAttribute(LLVMValueRef F, const char *Name,
size_t NameLen) {
if (auto *Fn = dyn_cast<Function>(unwrap<Value>(F))) {
return Fn->hasFnAttribute(Name);
return Fn->hasFnAttribute(StringRef(Name, NameLen));
}
return false;
}
extern "C" void LLVMRustRemoveFnAttribute(LLVMValueRef Fn, const char *Name) {
extern "C" void LLVMRustRemoveFnAttribute(LLVMValueRef Fn, const char *Name,
size_t NameLen) {
if (auto *F = dyn_cast<Function>(unwrap<Value>(Fn))) {
F->removeFnAttr(Name);
F->removeFnAttr(StringRef(Name, NameLen));
}
}