Support revisions for codegen tests
`compile-flags: -Copt-level` will avoid adding -O. Similarly for -g and -Cdebuglevel.
This commit is contained in:
parent
dcf5482cda
commit
4d97b28893
6 changed files with 115 additions and 49 deletions
|
|
@ -155,8 +155,6 @@ pub fn from_fn_attrs(
|
|||
let codegen_fn_attrs = id.map(|id| cx.tcx.codegen_fn_attrs(id))
|
||||
.unwrap_or_else(|| CodegenFnAttrs::new());
|
||||
|
||||
inline(cx, llfn, codegen_fn_attrs.inline);
|
||||
|
||||
match codegen_fn_attrs.optimize {
|
||||
OptimizeAttr::None => {
|
||||
match cx.tcx.sess.opts.optimize {
|
||||
|
|
@ -173,7 +171,7 @@ pub fn from_fn_attrs(
|
|||
OptLevel::No => {
|
||||
llvm::Attribute::MinSize.unapply_llfn(Function, llfn);
|
||||
llvm::Attribute::OptimizeForSize.unapply_llfn(Function, llfn);
|
||||
llvm::Attribute::OptimizeNone.apply_llfn(Function, llfn);
|
||||
llvm::Attribute::OptimizeNone.unapply_llfn(Function, llfn);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
@ -190,6 +188,8 @@ pub fn from_fn_attrs(
|
|||
}
|
||||
}
|
||||
|
||||
inline(cx, llfn, codegen_fn_attrs.inline);
|
||||
|
||||
// The `uwtable` attribute according to LLVM is:
|
||||
//
|
||||
// This attribute indicates that the ABI being targeted requires that an
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ fn declare_raw_fn(
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME(opt): this is kinda duplicated with similar code in attributes::from_fm_attrs…
|
||||
// FIXME(opt): this is kinda duplicated with similar code in attributes::from_fn_attrs…
|
||||
match cx.tcx.sess.opts.optimize {
|
||||
OptLevel::Size => {
|
||||
llvm::Attribute::MinSize.unapply_llfn(Function, llfn);
|
||||
|
|
@ -80,7 +80,7 @@ fn declare_raw_fn(
|
|||
OptLevel::No => {
|
||||
llvm::Attribute::MinSize.unapply_llfn(Function, llfn);
|
||||
llvm::Attribute::OptimizeForSize.unapply_llfn(Function, llfn);
|
||||
llvm::Attribute::OptimizeNone.apply_llfn(Function, llfn);
|
||||
llvm::Attribute::OptimizeNone.unapply_llfn(Function, llfn);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue