aboutsummaryrefslogtreecommitdiff
path: root/src/comp/middle/fold.rs
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-03-20 20:18:19 -0700
committerGraydon Hoare <[email protected]>2011-03-20 20:18:19 -0700
commit4b946cea35888bc82c624e9d79fade3077b40c3c (patch)
treef4a618c82541396930cd876ad938f81781f6422f /src/comp/middle/fold.rs
parentSwitch win32 path_sep to '/', add comment explaining a bit. (diff)
downloadrust-4b946cea35888bc82c624e9d79fade3077b40c3c.tar.xz
rust-4b946cea35888bc82c624e9d79fade3077b40c3c.zip
Modify native_item_fn to handle trailing linkage names that differ from the item name (used in win32 build of std.dll)
Diffstat (limited to 'src/comp/middle/fold.rs')
-rw-r--r--src/comp/middle/fold.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/comp/middle/fold.rs b/src/comp/middle/fold.rs
index 703c7ea4..5daa7f1d 100644
--- a/src/comp/middle/fold.rs
+++ b/src/comp/middle/fold.rs
@@ -233,6 +233,7 @@ type ast_fold[ENV] =
def_id id, ann a) -> @item) fold_item_fn,
(fn(&ENV e, &span sp, ident ident,
+ option.t[str] link_name,
&ast.fn_decl decl,
vec[ast.ty_param] ty_params,
def_id id, ann a) -> @native_item) fold_native_item_fn,
@@ -990,9 +991,10 @@ fn fold_native_item[ENV](&ENV env, ast_fold[ENV] fld,
case (ast.native_item_ty(?ident, ?id)) {
ret fld.fold_native_item_ty(env_, i.span, ident, id);
}
- case (ast.native_item_fn(?ident, ?fn_decl, ?ty_params, ?id, ?ann)) {
+ case (ast.native_item_fn(?ident, ?lname, ?fn_decl,
+ ?ty_params, ?id, ?ann)) {
auto d = fold_fn_decl[ENV](env_, fld, fn_decl);
- ret fld.fold_native_item_fn(env_, i.span, ident, d,
+ ret fld.fold_native_item_fn(env_, i.span, ident, lname, d,
ty_params, id, ann);
}
}
@@ -1346,10 +1348,11 @@ fn identity_fold_item_fn[ENV](&ENV e, &span sp, ident i,
}
fn identity_fold_native_item_fn[ENV](&ENV e, &span sp, ident i,
+ option.t[str] link_name,
&ast.fn_decl decl,
vec[ast.ty_param] ty_params,
def_id id, ann a) -> @native_item {
- ret @respan(sp, ast.native_item_fn(i, decl, ty_params, id, a));
+ ret @respan(sp, ast.native_item_fn(i, link_name, decl, ty_params, id, a));
}
fn identity_fold_item_mod[ENV](&ENV e, &span sp, ident i,
@@ -1576,7 +1579,7 @@ fn new_identity_fold[ENV]() -> ast_fold[ENV] {
fold_item_const= bind identity_fold_item_const[ENV](_,_,_,_,_,_,_),
fold_item_fn = bind identity_fold_item_fn[ENV](_,_,_,_,_,_,_),
fold_native_item_fn =
- bind identity_fold_native_item_fn[ENV](_,_,_,_,_,_,_),
+ bind identity_fold_native_item_fn[ENV](_,_,_,_,_,_,_,_),
fold_item_mod = bind identity_fold_item_mod[ENV](_,_,_,_,_),
fold_item_native_mod =
bind identity_fold_item_native_mod[ENV](_,_,_,_,_),