about summary refs log tree commit diff
path: root/src/comp/driver
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2012-02-02 12:37:17 +0100
committerMarijn Haverbeke <marijnh@gmail.com>2012-02-03 14:07:35 +0100
commit3bcd4fe6fa137287df34bed19eed5851f44aa703 (patch)
treeeb6acd4c1c50c6bbd7af1cf5b889bafaffac3f85 /src/comp/driver
parenta02f332602e504573977c3419ce0f239d954f5ec (diff)
downloadrust-3bcd4fe6fa137287df34bed19eed5851f44aa703.tar.gz
rust-3bcd4fe6fa137287df34bed19eed5851f44aa703.zip
Start on in-crate monomorphizing
Adds a --monomorpize flag to rustc to turn it on. You probably don't
want to use it yet, since it's broken in a whole bunch of ways, but it
successfully monomorphizes simple generic functions called from within
the crate.

Issue #1736
Diffstat (limited to 'src/comp/driver')
-rw-r--r--src/comp/driver/driver.rs3
-rw-r--r--src/comp/driver/session.rs1
2 files changed, 4 insertions, 0 deletions
diff --git a/src/comp/driver/driver.rs b/src/comp/driver/driver.rs
index 3f39ba1d123..f03e8d2c16c 100644
--- a/src/comp/driver/driver.rs
+++ b/src/comp/driver/driver.rs
@@ -357,6 +357,7 @@ fn build_session_options(match: getopts::match,
     if opt_present(match, "no-lint-ctypes") {
         lint_opts += [(lint::ctypes, false)];
     }
+    let monomorphize = opt_present(match, "monomorphize");
 
     let output_type =
         if parse_only || no_trans {
@@ -434,6 +435,7 @@ fn build_session_options(match: getopts::match,
           parse_only: parse_only,
           no_trans: no_trans,
           no_asm_comments: no_asm_comments,
+          monomorphize: monomorphize,
           warn_unused_imports: warn_unused_imports};
     ret sopts;
 }
@@ -493,6 +495,7 @@ fn opts() -> [getopts::opt] {
          optflag("time-passes"), optflag("time-llvm-passes"),
          optflag("no-verify"),
          optflag("no-lint-ctypes"),
+         optflag("monomorphize"),
          optmulti("cfg"), optflag("test"),
          optflag("lib"), optflag("bin"), optflag("static"), optflag("gc"),
          optflag("no-asm-comments"),
diff --git a/src/comp/driver/session.rs b/src/comp/driver/session.rs
index 30e7aec4374..36991e4e108 100644
--- a/src/comp/driver/session.rs
+++ b/src/comp/driver/session.rs
@@ -47,6 +47,7 @@ type options =
      parse_only: bool,
      no_trans: bool,
      no_asm_comments: bool,
+     monomorphize: bool,
      warn_unused_imports: bool};
 
 type crate_metadata = {name: str, data: [u8]};