Skip to content

Commit 29f2dc8

Browse files
committed
---
yaml --- r: 5656 b: refs/heads/master c: 968b66a h: refs/heads/master v: v3
1 parent 64ae589 commit 29f2dc8

File tree

8 files changed

+20
-3
lines changed

8 files changed

+20
-3
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: 9be0dc1250aaf657d9c50d4f98aacb73a9aa832c
2+
refs/heads/master: 968b66ad40c3925aaf34bf90740dfb3377c8d786

trunk/src/comp/metadata/creader.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ fn visit_item(e: env, i: @ast::item) {
5454
alt i.node {
5555
ast::item_native_mod(m) {
5656
if m.abi != ast::native_abi_rust && m.abi != ast::native_abi_cdecl &&
57-
m.abi != ast::native_abi_c_stack_cdecl {
57+
m.abi != ast::native_abi_c_stack_cdecl &&
58+
m.abi != ast::native_abi_c_stack_stdcall {
5859
ret;
5960
}
6061
let cstore = e.sess.get_cstore();

trunk/src/comp/metadata/tydecode.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ fn parse_ty(st: @pstate, sd: str_def) -> ty::t {
264264
'l' { abi = ast::native_abi_llvm; }
265265
's' { abi = ast::native_abi_x86stdcall; }
266266
'C' { abi = ast::native_abi_c_stack_cdecl; }
267+
'S' { abi = ast::native_abi_c_stack_stdcall; }
267268
}
268269
let func = parse_ty_fn(st, sd);
269270
ret ty::mk_native_fn(st.tcx, abi, func.args, func.ty);

trunk/src/comp/metadata/tyencode.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ fn enc_sty(w: io::writer, cx: @ctxt, st: ty::sty) {
148148
native_abi_llvm. { w.write_char('l'); }
149149
native_abi_x86stdcall. { w.write_char('s'); }
150150
native_abi_c_stack_cdecl. { w.write_char('C'); }
151+
native_abi_c_stack_stdcall. { w.write_char('S'); }
151152
}
152153
enc_ty_fn(w, cx, args, out, return_val, []);
153154
}

trunk/src/comp/middle/trans.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5741,7 +5741,8 @@ pure fn native_abi_requires_pair(abi: ast::native_abi) -> bool {
57415741
ast::native_abi_rust. | ast::native_abi_cdecl. |
57425742
ast::native_abi_llvm. | ast::native_abi_rust_intrinsic. |
57435743
ast::native_abi_x86stdcall. { ret true; }
5744-
ast::native_abi_c_stack_cdecl. { ret false; }
5744+
ast::native_abi_c_stack_cdecl. |
5745+
ast::native_abi_c_stack_stdcall. { ret false; }
57455746
}
57465747
}
57475748

@@ -5809,6 +5810,13 @@ fn register_native_fn(ccx: @crate_ctxt, sp: span, path: [str], name: str,
58095810
ccx.item_symbols.insert(id, name);
58105811
ret;
58115812
}
5813+
ast::native_abi_c_stack_stdcall. {
5814+
let llfn = decl_fn(ccx.llmod, name, lib::llvm::LLVMX86StdcallCallConv,
5815+
T_fn([], T_int()));
5816+
ccx.item_ids.insert(id, llfn);
5817+
ccx.item_symbols.insert(id, name);
5818+
ret;
5819+
}
58125820
}
58135821

58145822
let path = path;

trunk/src/comp/syntax/ast.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ tag native_abi {
420420
native_abi_rust_intrinsic;
421421
native_abi_x86stdcall;
422422
native_abi_c_stack_cdecl;
423+
native_abi_c_stack_stdcall;
423424
}
424425

425426
type native_mod =

trunk/src/comp/syntax/parse/parser.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,6 +2014,8 @@ fn parse_item_native_mod(p: parser, attrs: [ast::attribute]) -> @ast::item {
20142014
abi = ast::native_abi_x86stdcall;
20152015
} else if str::eq(t, "c-stack-cdecl") {
20162016
abi = ast::native_abi_c_stack_cdecl;
2017+
} else if str::eq(t, "c-stack-stdcall") {
2018+
abi = ast::native_abi_c_stack_stdcall;
20172019
} else {
20182020
p.fatal("unsupported abi: " + t);
20192021
}

trunk/src/comp/syntax/print/pprust.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,9 @@ fn print_item(s: ps, item: @ast::item) {
411411
ast::native_abi_c_stack_cdecl. {
412412
word_nbsp(s, "\"c-stack-cdecl\"");
413413
}
414+
ast::native_abi_c_stack_stdcall. {
415+
word_nbsp(s, "\"c-stack-stdcall\"");
416+
}
414417
}
415418
word_nbsp(s, "mod");
416419
word_nbsp(s, item.ident);

0 commit comments

Comments
 (0)