From 3aac5059ee986126851cb4f8bd312f1fb5f9ddea Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Thu, 10 Mar 2011 17:25:11 -0800 Subject: Move the glue code to a .o file. This reduces how much asm we print in each "translation unit". Part of it is not repetitive and should probably be moved to a .ll file, but for now we autogen all of it. (Modified somewhat by graydon while integrating). --- src/comp/driver/rustc.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/comp/driver') diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs index f26dd02e..00d41fff 100644 --- a/src/comp/driver/rustc.rs +++ b/src/comp/driver/rustc.rs @@ -84,6 +84,7 @@ fn usage(session.session sess, str argv0) { log ""; log " -o write output to "; log " -nowarn suppress wrong-compiler warning"; + log " -glue generate glue.bc file"; log " -shared compile a shared-library crate"; log " -pp pretty-print the input instead of compiling"; log " -h display this message"; @@ -113,6 +114,7 @@ impure fn main(vec[str] args) { let bool do_warn = true; let bool shared = false; let bool pretty = false; + let bool glue = false; auto i = 1u; auto len = _vec.len[str](args); @@ -123,6 +125,8 @@ impure fn main(vec[str] args) { if (_str.byte_len(arg) > 0u && arg.(0) == '-' as u8) { if (_str.eq(arg, "-nowarn")) { do_warn = false; + } else if (_str.eq(arg, "-glue")) { + glue = true; } else if (_str.eq(arg, "-shared")) { shared = true; } else if (_str.eq(arg, "-pp")) { @@ -159,6 +163,18 @@ impure fn main(vec[str] args) { warn_wrong_compiler(); } + if (glue) { + alt (output_file) { + case (none[str]) { + middle.trans.make_common_glue("glue.bc"); + } + case (some[str](?s)) { + middle.trans.make_common_glue(s); + } + } + ret; + } + alt (input_file) { case (none[str]) { usage(sess, args.(0)); -- cgit v1.2.3