Skip to content

Commit 6ec9116

Browse files
committed
---
yaml --- r: 14291 b: refs/heads/try c: 78034aa h: refs/heads/master i: 14289: cd78197 14287: 3f47d04 v: v3
1 parent 16eb1d4 commit 6ec9116

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: d7c8cacfde6c2dc08bb526a244cabf83af94eaa8
5+
refs/heads/try: 78034aa22aaca8d2e416752059a2d8e2a0d30768
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/comp/middle/trans/base.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4465,15 +4465,19 @@ fn trans_item(ccx: @crate_ctxt, item: ast::item) {
44654465
};
44664466
alt item.node {
44674467
ast::item_fn(decl, tps, body) {
4468-
alt ccx.item_ids.find(item.id) {
4469-
some(llfndecl) {
4470-
trans_fn(ccx, *path + [path_name(item.ident)], decl, body,
4471-
llfndecl, no_self, tps, none, item.id);
4472-
}
4468+
let llfndecl = alt ccx.item_ids.find(item.id) {
4469+
some(llfndecl) { llfndecl }
44734470
_ {
44744471
ccx.sess.span_fatal(item.span,
44754472
"unbound function item in trans_item");
44764473
}
4474+
};
4475+
if decl.purity != ast::crust_fn {
4476+
trans_fn(ccx, *path + [path_name(item.ident)], decl, body,
4477+
llfndecl, no_self, tps, none, item.id);
4478+
} else {
4479+
native::trans_crust_fn(ccx, *path + [path_name(item.ident)],
4480+
decl, body, llfndecl, item.id);
44774481
}
44784482
}
44794483
ast::item_impl(tps, _, _, ms) {

branches/try/src/comp/middle/trans/native.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import common::*;
77
import build::*;
88
import base::*;
99

10-
export link_name, trans_native_mod;
10+
export link_name, trans_native_mod, trans_crust_fn;
1111

1212
fn link_name(i: @ast::native_item) -> str {
1313
alt attr::get_meta_item_value_str_by_name(i.attrs, "link_name") {
@@ -189,3 +189,8 @@ fn trans_native_mod(ccx: @crate_ctxt,
189189
}
190190
}
191191
}
192+
193+
fn trans_crust_fn(ccx: @crate_ctxt, path: ast_map::path, decl: ast::fn_decl,
194+
body: ast::blk, llfndecl: ValueRef, id: ast::node_id) {
195+
trans_fn(ccx, path, decl, body, llfndecl, no_self, [], none, id)
196+
}

0 commit comments

Comments
 (0)