add -Z emit-stack-sizes
This commit is contained in:
parent
c3a1a0d340
commit
3c0907ce51
4 changed files with 10 additions and 2 deletions
|
@ -1385,6 +1385,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
|
||||||
"run the self profiler"),
|
"run the self profiler"),
|
||||||
profile_json: bool = (false, parse_bool, [UNTRACKED],
|
profile_json: bool = (false, parse_bool, [UNTRACKED],
|
||||||
"output a json file with profiler results"),
|
"output a json file with profiler results"),
|
||||||
|
emit_stack_sizes: bool = (false, parse_bool, [UNTRACKED],
|
||||||
|
"emits a section containing stack size metadata"),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn default_lib_output() -> CrateType {
|
pub fn default_lib_output() -> CrateType {
|
||||||
|
|
|
@ -196,6 +196,7 @@ pub fn target_machine_factory(sess: &Session, find_features: bool)
|
||||||
let features = CString::new(features).unwrap();
|
let features = CString::new(features).unwrap();
|
||||||
let is_pie_binary = !find_features && is_pie_binary(sess);
|
let is_pie_binary = !find_features && is_pie_binary(sess);
|
||||||
let trap_unreachable = sess.target.target.options.trap_unreachable;
|
let trap_unreachable = sess.target.target.options.trap_unreachable;
|
||||||
|
let emit_stack_size_section = sess.opts.debugging_opts.emit_stack_sizes;
|
||||||
|
|
||||||
let asm_comments = sess.asm_comments();
|
let asm_comments = sess.asm_comments();
|
||||||
|
|
||||||
|
@ -213,6 +214,7 @@ pub fn target_machine_factory(sess: &Session, find_features: bool)
|
||||||
trap_unreachable,
|
trap_unreachable,
|
||||||
singlethread,
|
singlethread,
|
||||||
asm_comments,
|
asm_comments,
|
||||||
|
emit_stack_size_section,
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1460,7 +1460,8 @@ extern "C" {
|
||||||
DataSections: bool,
|
DataSections: bool,
|
||||||
TrapUnreachable: bool,
|
TrapUnreachable: bool,
|
||||||
Singlethread: bool,
|
Singlethread: bool,
|
||||||
AsmComments: bool)
|
AsmComments: bool,
|
||||||
|
EmitStackSizeSection: bool)
|
||||||
-> Option<&'static mut TargetMachine>;
|
-> Option<&'static mut TargetMachine>;
|
||||||
pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine);
|
pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine);
|
||||||
pub fn LLVMRustAddAnalysisPasses(T: &'a TargetMachine, PM: &PassManager<'a>, M: &'a Module);
|
pub fn LLVMRustAddAnalysisPasses(T: &'a TargetMachine, PM: &PassManager<'a>, M: &'a Module);
|
||||||
|
|
|
@ -373,7 +373,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
|
||||||
bool DataSections,
|
bool DataSections,
|
||||||
bool TrapUnreachable,
|
bool TrapUnreachable,
|
||||||
bool Singlethread,
|
bool Singlethread,
|
||||||
bool AsmComments) {
|
bool AsmComments,
|
||||||
|
bool EmitStackSizeSection) {
|
||||||
|
|
||||||
auto OptLevel = fromRust(RustOptLevel);
|
auto OptLevel = fromRust(RustOptLevel);
|
||||||
auto RM = fromRust(RustReloc);
|
auto RM = fromRust(RustReloc);
|
||||||
|
@ -411,6 +412,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LLVM_VERSION_GE(6, 0)
|
#if LLVM_VERSION_GE(6, 0)
|
||||||
|
Options.EmitStackSizeSection = EmitStackSizeSection;
|
||||||
|
|
||||||
Optional<CodeModel::Model> CM;
|
Optional<CodeModel::Model> CM;
|
||||||
#else
|
#else
|
||||||
CodeModel::Model CM = CodeModel::Model::Default;
|
CodeModel::Model CM = CodeModel::Model::Default;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue