Skip to content

Commit 5019cc4

Browse files
authored
Send llvm-args to libgccjit (#45)
1 parent 7de70f4 commit 5019cc4

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ harness = false
1616
[dependencies]
1717
gccjit = { git = "https://github.com/antoyo/gccjit.rs" }
1818

19+
# Local copy.
20+
#gccjit = { path = "../gccjit.rs" }
21+
1922
target-lexicon = "0.10.0"
2023

2124
ar = "0.8.0"

src/base.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ pub fn compile_codegen_unit<'tcx>(tcx: TyCtxt<'tcx>, cgu_name: Symbol) -> (Modul
7575
let context = Context::default();
7676
// TODO: only set on x86 platforms.
7777
context.add_command_line_option("-masm=intel");
78+
for arg in &tcx.sess.opts.cg.llvm_args {
79+
context.add_command_line_option(arg);
80+
}
7881
//context.set_dump_code_on_compile(true);
7982
if env::var("CG_GCCJIT_DUMP_GIMPLE").as_deref() == Ok("1") {
8083
context.set_dump_initial_gimple(true);

0 commit comments

Comments
 (0)