rustc: Stub a --stack-growth option; it's behind a flag for now because it requires patches to LLVM.
This commit is contained in:
parent
f525f6e94c
commit
e9287e55cc
4 changed files with 21 additions and 8 deletions
|
@ -263,6 +263,7 @@ options:
|
||||||
--no-typestate don't run the typestate pass (unsafe!)
|
--no-typestate don't run the typestate pass (unsafe!)
|
||||||
--test build test harness
|
--test build test harness
|
||||||
--gc garbage collect shared data (experimental/temporary)
|
--gc garbage collect shared data (experimental/temporary)
|
||||||
|
--stack-growth perform stack checks (experimental)
|
||||||
|
|
||||||
");
|
");
|
||||||
}
|
}
|
||||||
|
@ -386,6 +387,7 @@ fn build_session_options(binary: str, match: getopts::match)
|
||||||
let cfg = parse_cfgspecs(getopts::opt_strs(match, "cfg"));
|
let cfg = parse_cfgspecs(getopts::opt_strs(match, "cfg"));
|
||||||
let test = opt_present(match, "test");
|
let test = opt_present(match, "test");
|
||||||
let do_gc = opt_present(match, "gc");
|
let do_gc = opt_present(match, "gc");
|
||||||
|
let stack_growth = opt_present(match, "stack-growth");
|
||||||
let sopts: @session::options =
|
let sopts: @session::options =
|
||||||
@{library: library,
|
@{library: library,
|
||||||
static: static,
|
static: static,
|
||||||
|
@ -405,7 +407,8 @@ fn build_session_options(binary: str, match: getopts::match)
|
||||||
test: test,
|
test: test,
|
||||||
parse_only: parse_only,
|
parse_only: parse_only,
|
||||||
no_trans: no_trans,
|
no_trans: no_trans,
|
||||||
do_gc: do_gc};
|
do_gc: do_gc,
|
||||||
|
stack_growth: stack_growth};
|
||||||
ret sopts;
|
ret sopts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,7 +442,8 @@ fn opts() -> [getopts::opt] {
|
||||||
optflag("time-passes"), optflag("time-llvm-passes"),
|
optflag("time-passes"), optflag("time-llvm-passes"),
|
||||||
optflag("no-typestate"), optflag("noverify"),
|
optflag("no-typestate"), optflag("noverify"),
|
||||||
optmulti("cfg"), optflag("test"),
|
optmulti("cfg"), optflag("test"),
|
||||||
optflag("lib"), optflag("static"), optflag("gc")];
|
optflag("lib"), optflag("static"), optflag("gc"),
|
||||||
|
optflag("stack-growth")];
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main(args: [str]) {
|
fn main(args: [str]) {
|
||||||
|
|
|
@ -39,7 +39,8 @@ type options =
|
||||||
test: bool,
|
test: bool,
|
||||||
parse_only: bool,
|
parse_only: bool,
|
||||||
no_trans: bool,
|
no_trans: bool,
|
||||||
do_gc: bool};
|
do_gc: bool,
|
||||||
|
stack_growth: bool};
|
||||||
|
|
||||||
type crate_metadata = {name: str, data: [u8]};
|
type crate_metadata = {name: str, data: [u8]};
|
||||||
|
|
||||||
|
|
|
@ -455,9 +455,9 @@ native "cdecl" mod llvm = "rustllvm" {
|
||||||
fn LLVMSetFunctionCallConv(Fn: ValueRef, CC: uint);
|
fn LLVMSetFunctionCallConv(Fn: ValueRef, CC: uint);
|
||||||
fn LLVMGetGC(Fn: ValueRef) -> sbuf;
|
fn LLVMGetGC(Fn: ValueRef) -> sbuf;
|
||||||
fn LLVMSetGC(Fn: ValueRef, Name: sbuf);
|
fn LLVMSetGC(Fn: ValueRef, Name: sbuf);
|
||||||
fn LLVMAddFunctionAttr(Fn: ValueRef, PA: Attribute);
|
fn LLVMAddFunctionAttr(Fn: ValueRef, PA: Attribute, HighPA: uint);
|
||||||
fn LLVMGetFunctionAttr(Fn: ValueRef) -> Attribute;
|
fn LLVMGetFunctionAttr(Fn: ValueRef) -> Attribute;
|
||||||
fn LLVMRemoveFunctionAttr(Fn: ValueRef, PA: Attribute);
|
fn LLVMRemoveFunctionAttr(Fn: ValueRef, PA: Attribute, HighPA: uint);
|
||||||
|
|
||||||
/* Operations on parameters */
|
/* Operations on parameters */
|
||||||
fn LLVMCountParams(Fn: ValueRef) -> uint;
|
fn LLVMCountParams(Fn: ValueRef) -> uint;
|
||||||
|
|
|
@ -1087,7 +1087,8 @@ fn get_static_tydesc(cx: @block_ctxt, orig_t: ty::t, ty_params: [uint],
|
||||||
fn set_no_inline(f: ValueRef) {
|
fn set_no_inline(f: ValueRef) {
|
||||||
llvm::LLVMAddFunctionAttr(f,
|
llvm::LLVMAddFunctionAttr(f,
|
||||||
lib::llvm::LLVMNoInlineAttribute as
|
lib::llvm::LLVMNoInlineAttribute as
|
||||||
lib::llvm::llvm::Attribute);
|
lib::llvm::llvm::Attribute,
|
||||||
|
0u);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tell LLVM to emit the information necessary to unwind the stack for the
|
// Tell LLVM to emit the information necessary to unwind the stack for the
|
||||||
|
@ -1095,13 +1096,20 @@ fn set_no_inline(f: ValueRef) {
|
||||||
fn set_uwtable(f: ValueRef) {
|
fn set_uwtable(f: ValueRef) {
|
||||||
llvm::LLVMAddFunctionAttr(f,
|
llvm::LLVMAddFunctionAttr(f,
|
||||||
lib::llvm::LLVMUWTableAttribute as
|
lib::llvm::LLVMUWTableAttribute as
|
||||||
lib::llvm::llvm::Attribute);
|
lib::llvm::llvm::Attribute,
|
||||||
|
0u);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_always_inline(f: ValueRef) {
|
fn set_always_inline(f: ValueRef) {
|
||||||
llvm::LLVMAddFunctionAttr(f,
|
llvm::LLVMAddFunctionAttr(f,
|
||||||
lib::llvm::LLVMAlwaysInlineAttribute as
|
lib::llvm::LLVMAlwaysInlineAttribute as
|
||||||
lib::llvm::llvm::Attribute);
|
lib::llvm::llvm::Attribute,
|
||||||
|
0u);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn set_custom_stack_growth_fn(f: ValueRef) {
|
||||||
|
// TODO: Remove this hack to work around the lack of u64 in the FFI.
|
||||||
|
llvm::LLVMAddFunctionAttr(f, 0 as lib::llvm::llvm::Attribute, 1u);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_glue_inlining(cx: @local_ctxt, f: ValueRef, t: ty::t) {
|
fn set_glue_inlining(cx: @local_ctxt, f: ValueRef, t: ty::t) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue