rustc: Add trans_crust_fn. Don't do anything special yet
This commit is contained in:
parent
d7c8cacfde
commit
78034aa22a
2 changed files with 15 additions and 6 deletions
|
@ -4465,15 +4465,19 @@ fn trans_item(ccx: @crate_ctxt, item: ast::item) {
|
|||
};
|
||||
alt item.node {
|
||||
ast::item_fn(decl, tps, body) {
|
||||
alt ccx.item_ids.find(item.id) {
|
||||
some(llfndecl) {
|
||||
trans_fn(ccx, *path + [path_name(item.ident)], decl, body,
|
||||
llfndecl, no_self, tps, none, item.id);
|
||||
}
|
||||
let llfndecl = alt ccx.item_ids.find(item.id) {
|
||||
some(llfndecl) { llfndecl }
|
||||
_ {
|
||||
ccx.sess.span_fatal(item.span,
|
||||
"unbound function item in trans_item");
|
||||
}
|
||||
};
|
||||
if decl.purity != ast::crust_fn {
|
||||
trans_fn(ccx, *path + [path_name(item.ident)], decl, body,
|
||||
llfndecl, no_self, tps, none, item.id);
|
||||
} else {
|
||||
native::trans_crust_fn(ccx, *path + [path_name(item.ident)],
|
||||
decl, body, llfndecl, item.id);
|
||||
}
|
||||
}
|
||||
ast::item_impl(tps, _, _, ms) {
|
||||
|
|
|
@ -7,7 +7,7 @@ import common::*;
|
|||
import build::*;
|
||||
import base::*;
|
||||
|
||||
export link_name, trans_native_mod;
|
||||
export link_name, trans_native_mod, trans_crust_fn;
|
||||
|
||||
fn link_name(i: @ast::native_item) -> str {
|
||||
alt attr::get_meta_item_value_str_by_name(i.attrs, "link_name") {
|
||||
|
@ -189,3 +189,8 @@ fn trans_native_mod(ccx: @crate_ctxt,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn trans_crust_fn(ccx: @crate_ctxt, path: ast_map::path, decl: ast::fn_decl,
|
||||
body: ast::blk, llfndecl: ValueRef, id: ast::node_id) {
|
||||
trans_fn(ccx, path, decl, body, llfndecl, no_self, [], none, id)
|
||||
}
|
Loading…
Reference in a new issue