aboutsummaryrefslogtreecommitdiff
path: root/src/comp/driver
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-03-10 17:25:11 -0800
committerGraydon Hoare <[email protected]>2011-03-10 17:30:08 -0800
commit3aac5059ee986126851cb4f8bd312f1fb5f9ddea (patch)
treed451418a7792e1f170a6b5e2b5713627b6aa04b4 /src/comp/driver
parentrustc: Build up a list of upvars inside foreach bodies (diff)
downloadrust-3aac5059ee986126851cb4f8bd312f1fb5f9ddea.tar.xz
rust-3aac5059ee986126851cb4f8bd312f1fb5f9ddea.zip
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).
Diffstat (limited to 'src/comp/driver')
-rw-r--r--src/comp/driver/rustc.rs16
1 files changed, 16 insertions, 0 deletions
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 <filename> write output to <filename>";
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));