mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
parent
0aa8d03202
commit
66fd1ebfae
@ -182,6 +182,8 @@ pub fn target_machine_factory(sess: &Session, find_features: bool)
|
||||
let is_pie_binary = !find_features && is_pie_binary(sess);
|
||||
let trap_unreachable = sess.target.target.options.trap_unreachable;
|
||||
|
||||
let asm_comments = sess.asm_comments();
|
||||
|
||||
Arc::new(move || {
|
||||
let tm = unsafe {
|
||||
llvm::LLVMRustCreateTargetMachine(
|
||||
@ -195,6 +197,7 @@ pub fn target_machine_factory(sess: &Session, find_features: bool)
|
||||
fdata_sections,
|
||||
trap_unreachable,
|
||||
singlethread,
|
||||
asm_comments,
|
||||
)
|
||||
};
|
||||
|
||||
|
@ -1455,7 +1455,8 @@ extern "C" {
|
||||
FunctionSections: bool,
|
||||
DataSections: bool,
|
||||
TrapUnreachable: bool,
|
||||
Singlethread: bool)
|
||||
Singlethread: bool,
|
||||
AsmComments: bool)
|
||||
-> Option<&'static mut TargetMachine>;
|
||||
pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine);
|
||||
pub fn LLVMRustAddAnalysisPasses(T: &'a TargetMachine, PM: &PassManager<'a>, M: &'a Module);
|
||||
|
@ -366,7 +366,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
|
||||
bool PositionIndependentExecutable, bool FunctionSections,
|
||||
bool DataSections,
|
||||
bool TrapUnreachable,
|
||||
bool Singlethread) {
|
||||
bool Singlethread,
|
||||
bool AsmComments) {
|
||||
|
||||
auto OptLevel = fromRust(RustOptLevel);
|
||||
auto RM = fromRust(RustReloc);
|
||||
@ -393,6 +394,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
|
||||
}
|
||||
Options.DataSections = DataSections;
|
||||
Options.FunctionSections = FunctionSections;
|
||||
Options.MCOptions.AsmVerbose = AsmComments;
|
||||
Options.MCOptions.PreserveAsmComments = AsmComments;
|
||||
|
||||
if (TrapUnreachable) {
|
||||
// Tell LLVM to codegen `unreachable` into an explicit trap instruction.
|
||||
|
Loading…
Reference in New Issue
Block a user