Skip to content

Commit 4396837

Browse files
committed
---
yaml --- r: 5647 b: refs/heads/master c: e9287e5 h: refs/heads/master i: 5645: 54ecf7a 5643: 7fc1726 5639: 0be7be8 5631: d667f7e v: v3
1 parent feeb303 commit 4396837

File tree

5 files changed

+22
-9
lines changed

5 files changed

+22
-9
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: f525f6e94ceba86766eb8260abfe2dc1acc43702
2+
refs/heads/master: e9287e55cc6f95354632be646be18b92af2f9a08

trunk/src/comp/driver/rustc.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ options:
263263
--no-typestate don't run the typestate pass (unsafe!)
264264
--test build test harness
265265
--gc garbage collect shared data (experimental/temporary)
266+
--stack-growth perform stack checks (experimental)
266267
267268
");
268269
}
@@ -386,6 +387,7 @@ fn build_session_options(binary: str, match: getopts::match)
386387
let cfg = parse_cfgspecs(getopts::opt_strs(match, "cfg"));
387388
let test = opt_present(match, "test");
388389
let do_gc = opt_present(match, "gc");
390+
let stack_growth = opt_present(match, "stack-growth");
389391
let sopts: @session::options =
390392
@{library: library,
391393
static: static,
@@ -405,7 +407,8 @@ fn build_session_options(binary: str, match: getopts::match)
405407
test: test,
406408
parse_only: parse_only,
407409
no_trans: no_trans,
408-
do_gc: do_gc};
410+
do_gc: do_gc,
411+
stack_growth: stack_growth};
409412
ret sopts;
410413
}
411414

@@ -439,7 +442,8 @@ fn opts() -> [getopts::opt] {
439442
optflag("time-passes"), optflag("time-llvm-passes"),
440443
optflag("no-typestate"), optflag("noverify"),
441444
optmulti("cfg"), optflag("test"),
442-
optflag("lib"), optflag("static"), optflag("gc")];
445+
optflag("lib"), optflag("static"), optflag("gc"),
446+
optflag("stack-growth")];
443447
}
444448

445449
fn main(args: [str]) {

trunk/src/comp/driver/session.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ type options =
3939
test: bool,
4040
parse_only: bool,
4141
no_trans: bool,
42-
do_gc: bool};
42+
do_gc: bool,
43+
stack_growth: bool};
4344

4445
type crate_metadata = {name: str, data: [u8]};
4546

trunk/src/comp/lib/llvm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,9 @@ native "cdecl" mod llvm = "rustllvm" {
455455
fn LLVMSetFunctionCallConv(Fn: ValueRef, CC: uint);
456456
fn LLVMGetGC(Fn: ValueRef) -> sbuf;
457457
fn LLVMSetGC(Fn: ValueRef, Name: sbuf);
458-
fn LLVMAddFunctionAttr(Fn: ValueRef, PA: Attribute);
458+
fn LLVMAddFunctionAttr(Fn: ValueRef, PA: Attribute, HighPA: uint);
459459
fn LLVMGetFunctionAttr(Fn: ValueRef) -> Attribute;
460-
fn LLVMRemoveFunctionAttr(Fn: ValueRef, PA: Attribute);
460+
fn LLVMRemoveFunctionAttr(Fn: ValueRef, PA: Attribute, HighPA: uint);
461461

462462
/* Operations on parameters */
463463
fn LLVMCountParams(Fn: ValueRef) -> uint;

trunk/src/comp/middle/trans.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,21 +1087,29 @@ fn get_static_tydesc(cx: @block_ctxt, orig_t: ty::t, ty_params: [uint],
10871087
fn set_no_inline(f: ValueRef) {
10881088
llvm::LLVMAddFunctionAttr(f,
10891089
lib::llvm::LLVMNoInlineAttribute as
1090-
lib::llvm::llvm::Attribute);
1090+
lib::llvm::llvm::Attribute,
1091+
0u);
10911092
}
10921093

10931094
// Tell LLVM to emit the information necessary to unwind the stack for the
10941095
// function f.
10951096
fn set_uwtable(f: ValueRef) {
10961097
llvm::LLVMAddFunctionAttr(f,
10971098
lib::llvm::LLVMUWTableAttribute as
1098-
lib::llvm::llvm::Attribute);
1099+
lib::llvm::llvm::Attribute,
1100+
0u);
10991101
}
11001102

11011103
fn set_always_inline(f: ValueRef) {
11021104
llvm::LLVMAddFunctionAttr(f,
11031105
lib::llvm::LLVMAlwaysInlineAttribute as
1104-
lib::llvm::llvm::Attribute);
1106+
lib::llvm::llvm::Attribute,
1107+
0u);
1108+
}
1109+
1110+
fn set_custom_stack_growth_fn(f: ValueRef) {
1111+
// TODO: Remove this hack to work around the lack of u64 in the FFI.
1112+
llvm::LLVMAddFunctionAttr(f, 0 as lib::llvm::llvm::Attribute, 1u);
11051113
}
11061114

11071115
fn set_glue_inlining(cx: @local_ctxt, f: ValueRef, t: ty::t) {

0 commit comments

Comments
 (0)