Skip to content

Commit 87cdff9

Browse files
author
Rafael Avila de Espindola
committed
---
yaml --- r: 1395 b: refs/heads/master c: a63696d h: refs/heads/master i: 1393: 5f37ee3 1391: e20878d v: v3
1 parent 3c939f9 commit 87cdff9

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 293637139fe55990397849badfb60c96d4211b31
2+
refs/heads/master: a63696dfe2bd47d34925a3ad44db9d2ede949e36

trunk/src/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ TEST_XFAILS_RUSTC := $(filter-out \
507507
linear-for-loop.rs \
508508
multiline-comment.rs \
509509
mutual-recursion-group.rs \
510+
native2.rs \
510511
obj-drop.rs \
511512
obj-recursion.rs \
512513
obj-with-vec.rs \

trunk/src/comp/middle/trans.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4062,12 +4062,24 @@ fn decl_fn_and_pair(@crate_ctxt cx,
40624062
cx.fn_pairs.insert(id, gvar);
40634063
}
40644064

4065+
fn decl_native_fn_and_pair(@crate_ctxt cx,
4066+
str name,
4067+
&ast.ann ann,
4068+
ast.def_id id) {
4069+
4070+
auto llpairty = node_type(cx, ann);
4071+
auto llfty = get_pair_fn_ty(llpairty);
4072+
4073+
let ValueRef llfn = decl_fastcall_fn(cx.llmod, name, llfty);
4074+
cx.item_ids.insert(id, llfn);
4075+
}
4076+
40654077
fn collect_native_item(&@crate_ctxt cx, @ast.native_item i) -> @crate_ctxt {
40664078
alt (i.node) {
40674079
case (ast.native_item_fn(?name, _, _, ?fid, ?ann)) {
40684080
cx.native_items.insert(fid, i);
40694081
if (! cx.obj_methods.contains_key(fid)) {
4070-
decl_fn_and_pair(cx, "fn", name, ann, fid);
4082+
decl_native_fn_and_pair(cx, name, ann, fid);
40714083
}
40724084
}
40734085
case (_) { /* fall through */ }

0 commit comments

Comments
 (0)