Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc/metadata/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ fn purity_static_method_family(p: purity) -> char {
fn should_inline(attrs: &[attribute]) -> bool {
match attr::find_inline_attr(attrs) {
attr::ia_none | attr::ia_never => false,
attr::ia_hint | attr::ia_always => true
attr::ia_maybe | attr::ia_hint | attr::ia_always => true
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ pub fn set_inline_hint_if_appr(attrs: &[ast::attribute],
attr::ia_hint => set_inline_hint(llfn),
attr::ia_always => set_always_inline(llfn),
attr::ia_never => set_no_inline(llfn),
attr::ia_none => { /* fallthrough */ }
attr::ia_maybe | attr::ia_none => { /* fallthrough */ }
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/trans/reachable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
}
item_fn(_, _, _, ref generics, ref blk) => {
if generics.ty_params.len() > 0u ||
attr::find_inline_attr(item.attrs) != attr::ia_none {
attr::find_inline_attr(item.attrs) != attr::ia_none { // XXX why is this ia_none?
traverse_inline_body(cx, blk);
}
}
item_impl(ref generics, _, _, ref ms) => {
for ms.each |m| {
if generics.ty_params.len() > 0u ||
m.generics.ty_params.len() > 0u ||
attr::find_inline_attr(m.attrs) != attr::ia_none
attr::find_inline_attr(m.attrs) != attr::ia_none // XXX why is this ia_none?
{
{
let cx = &mut *cx; // FIXME(#6269) reborrow @mut to &mut
Expand Down
7 changes: 6 additions & 1 deletion src/libsyntax/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,9 @@ pub fn find_linkage_metas(attrs: &[ast::attribute]) -> ~[@ast::meta_item] {
#[deriving(Eq)]
pub enum inline_attr {
ia_none,
// just write the inlining info to crate metadata, don't hint
// LLVM, because that can be too forceful
ia_maybe,
ia_hint,
ia_always,
ia_never,
Expand All @@ -316,7 +319,9 @@ pub fn find_inline_attr(attrs: &[ast::attribute]) -> inline_attr {
match attr.node.value.node {
ast::meta_word(@~"inline") => ia_hint,
ast::meta_list(@~"inline", ref items) => {
if !find_meta_items_by_name(*items, "always").is_empty() {
if !find_meta_items_by_name(*items, "maybe").is_empty() {
ia_maybe
} else if !find_meta_items_by_name(*items, "always").is_empty() {
ia_always
} else if !find_meta_items_by_name(*items, "never").is_empty() {
ia_never
Expand Down