Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/librustc_codegen_llvm/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ pub fn target_machine_factory(sess: &Session, optlvl: config::OptLevel, find_fea
let emit_stack_size_section = sess.opts.debugging_opts.emit_stack_sizes;

let asm_comments = sess.asm_comments();
let no_integrated_as = sess.target.target.options.no_integrated_as;

Arc::new(move || {
let tm = unsafe {
Expand All @@ -182,6 +183,7 @@ pub fn target_machine_factory(sess: &Session, optlvl: config::OptLevel, find_fea
singlethread,
asm_comments,
emit_stack_size_section,
no_integrated_as,
)
};

Expand Down
3 changes: 2 additions & 1 deletion src/librustc_codegen_llvm/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1691,7 +1691,8 @@ extern "C" {
TrapUnreachable: bool,
Singlethread: bool,
AsmComments: bool,
EmitStackSizeSection: bool)
EmitStackSizeSection: bool,
NoIntegratedAs: bool)
-> Option<&'static mut TargetMachine>;
pub fn LLVMRustDisposeTargetMachine(T: &'static mut TargetMachine);
pub fn LLVMRustAddAnalysisPasses(T: &'a TargetMachine, PM: &PassManager<'a>, M: &'a Module);
Expand Down
4 changes: 3 additions & 1 deletion src/rustllvm/PassWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,8 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
bool TrapUnreachable,
bool Singlethread,
bool AsmComments,
bool EmitStackSizeSection) {
bool EmitStackSizeSection,
bool NoIntegratedAs) {

auto OptLevel = fromRust(RustOptLevel);
auto RM = fromRust(RustReloc);
Expand All @@ -376,6 +377,7 @@ extern "C" LLVMTargetMachineRef LLVMRustCreateTargetMachine(
Options.FunctionSections = FunctionSections;
Options.MCOptions.AsmVerbose = AsmComments;
Options.MCOptions.PreserveAsmComments = AsmComments;
Options.DisableIntegratedAS = NoIntegratedAs;

if (TrapUnreachable) {
// Tell LLVM to codegen `unreachable` into an explicit trap instruction.
Expand Down