Remove LLVM attribute removal

This was necessary before, because `declare_raw_fn` would always apply
the default optimization attributes to every declared function,
and then `attributes::from_fn_attrs` would have to remove the default
attributes in the case of, e.g. `#[optimize(speed)]` in a `-Os` build.

However, every relevant callsite of `declare_raw_fn` (i.e. where we
actually generate code for the function, and not e.g. a call to an
intrinsic, where optimization attributes don't [?] matter)
calls `from_fn_attrs`, so we can simply remove the attribute setting
from `declare_raw_fn`, and rely on `from_fn_attrs` to apply the correct
attributes all at once.
This commit is contained in:
Erik Desjardins 2022-02-21 14:47:56 -05:00
parent b07d59f794
commit dce14cfacc
5 changed files with 13 additions and 87 deletions

View file

@ -1201,12 +1201,6 @@ extern "C" {
Attrs: *const &'a Attribute,
AttrsLen: size_t,
);
pub fn LLVMRustRemoveFunctionAttributes(
Fn: &Value,
index: c_uint,
Attrs: *const AttributeKind,
AttrsLen: size_t,
);
// Operations on parameters
pub fn LLVMIsAArgument(Val: &Value) -> Option<&Value>;