Attribute::NoInline.apply_llfn(Function, val);
}
}
- None => {
- Attribute::InlineHint.unapply_llfn(Function, val);
- Attribute::AlwaysInline.unapply_llfn(Function, val);
- Attribute::NoInline.unapply_llfn(Function, val);
- }
+ None => {}
};
}
return;
}
- // FIXME(richkadel): Make sure probestack plays nice with `-Z instrument-coverage`
- // or disable it if not, similar to above early exits.
-
// Flag our internal `__rust_probestack` function as the stack probe symbol.
// This is defined in the `compiler-builtins` crate for each architecture.
llvm::AddFunctionAttrStringValue(
);
}
-fn translate_obsolete_target_features(feature: &str) -> &str {
- const LLVM9_FEATURE_CHANGES: &[(&str, &str)] =
- &[("+fp-only-sp", "-fp64"), ("-fp-only-sp", "+fp64"), ("+d16", "-d32"), ("-d16", "+d32")];
- if llvm_util::get_major_version() >= 9 {
- for &(old, new) in LLVM9_FEATURE_CHANGES {
- if feature == old {
- return new;
- }
- }
- } else {
- for &(old, new) in LLVM9_FEATURE_CHANGES {
- if feature == new {
- return old;
- }
- }
- }
- feature
-}
-
pub fn llvm_target_features(sess: &Session) -> impl Iterator<Item = &str> {
const RUSTC_SPECIFIC_FEATURES: &[&str] = &["crt-static"];
.target_feature
.split(',')
.filter(|f| !RUSTC_SPECIFIC_FEATURES.iter().any(|s| f.contains(s)));
- sess.target
- .features
- .split(',')
- .chain(cmdline)
- .filter(|l| !l.is_empty())
- .map(translate_obsolete_target_features)
+ sess.target.features.split(',').chain(cmdline).filter(|l| !l.is_empty())
}
pub fn apply_target_cpu_attr(cx: &CodegenCx<'ll, '_>, llfn: &'ll Value) {
}
}
- // FIXME(eddyb) consolidate these two `inline` calls (and avoid overwrites).
- if instance.def.requires_inline(cx.tcx) {
- inline(cx, llfn, attributes::InlineAttr::Hint);
- }
-
- inline(cx, llfn, codegen_fn_attrs.inline.clone());
+ let inline_attr = if codegen_fn_attrs.flags.contains(CodegenFnAttrFlags::NAKED) {
+ InlineAttr::Never
+ } else if codegen_fn_attrs.inline == InlineAttr::None && instance.def.requires_inline(cx.tcx) {
+ InlineAttr::Hint
+ } else {
+ codegen_fn_attrs.inline
+ };
+ inline(cx, llfn, inline_attr);
// The `uwtable` attribute according to LLVM is:
//