about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-09-28 15:26:11 -0700
committerBrian Anderson <banderson@mozilla.com>2011-09-28 15:35:21 -0700
commit15e34deba3efa7c064bf9ffe0fa1eff47f9b117e (patch)
tree32b1f995f115e0fe1d9d846c96dc702cb63f7990 /src/comp
parente1ba559c03624990e06b98d4329d5daee089acca (diff)
Eliminate glue.o. Closes #990
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/back/link.rs3
-rw-r--r--src/comp/driver/rustc.rs12
-rw-r--r--src/comp/middle/trans.rs31
-rw-r--r--src/comp/middle/trans_common.rs3
4 files changed, 2 insertions, 47 deletions
diff --git a/src/comp/back/link.rs b/src/comp/back/link.rs
index 73df1462134..dd952bb0db3 100644
--- a/src/comp/back/link.rs
+++ b/src/comp/back/link.rs
@@ -497,14 +497,13 @@ fn mangle_internal_name_by_seq(ccx: @crate_ctxt, flav: str) -> str {
 fn link_binary(sess: session::session,
                binary_dir: str,
                saved_out_filename: str) {
-    let glu: str = binary_dir + "/lib/glue.o";
     let main: str = binary_dir + "/lib/main.o";
     let stage: str = "-L" + binary_dir + "/lib";
     let prog: str = "gcc";
     // The invocations of gcc share some flags across platforms
 
     let gcc_args =
-        [stage, "-Lrt", "-lrustrt", glu, "-m32", "-o", saved_out_filename,
+        [stage, "-Lrt", "-lrustrt", "-m32", "-o", saved_out_filename,
          saved_out_filename + ".o"];
     let lib_cmd;
 
diff --git a/src/comp/driver/rustc.rs b/src/comp/driver/rustc.rs
index b1f7fa84f42..9887664caf5 100644
--- a/src/comp/driver/rustc.rs
+++ b/src/comp/driver/rustc.rs
@@ -238,7 +238,6 @@ options:
     -v --version       print version info and exit
 
     -o <filename>      write output to <filename>
-    --glue             generate glue.bc file
     --lib              compile a library crate
     --static           use or produce static libraries
     --pretty [type]    pretty-print the input instead of compiling
@@ -424,7 +423,7 @@ fn parse_pretty(sess: session::session, name: str) -> pp_mode {
 
 fn opts() -> [getopts::opt] {
     ret [optflag("h"), optflag("help"), optflag("v"), optflag("version"),
-         optflag("glue"), optflag("emit-llvm"), optflagopt("pretty"),
+         optflag("emit-llvm"), optflagopt("pretty"),
          optflag("ls"), optflag("parse-only"), optflag("no-trans"),
          optflag("O"), optopt("OptLevel"), optmulti("L"), optflag("S"),
          optflag("c"), optopt("o"), optflag("g"), optflag("save-temps"),
@@ -458,15 +457,6 @@ fn main(args: [str]) {
     let sess = build_session(sopts);
     let n_inputs = vec::len::<str>(match.free);
     let output_file = getopts::opt_maybe_str(match, "o");
-    let glue = opt_present(match, "glue");
-    if glue {
-        if n_inputs > 0u {
-            sess.fatal("No input files allowed with --glue.");
-        }
-        let out = option::from_maybe::<str>("glue.bc", output_file);
-        middle::trans::make_common_glue(sess, out);
-        ret;
-    }
     if n_inputs == 0u {
         sess.fatal("No input filename given.");
     } else if n_inputs > 1u {
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index a74f358795e..1a6f046b0cd 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -6044,35 +6044,6 @@ fn decl_no_op_type_glue(llmod: ModuleRef, taskptr_type: TypeRef) -> ValueRef {
     ret decl_cdecl_fn(llmod, abi::no_op_type_glue_name(), ty);
 }
 
-fn make_glues(llmod: ModuleRef, taskptr_type: TypeRef) -> @glue_fns {
-    ret @{no_op_type_glue: decl_no_op_type_glue(llmod, taskptr_type)};
-}
-
-fn make_common_glue(sess: session::session, output: str) {
-    // FIXME: part of this is repetitive and is probably a good idea
-    // to autogen it.
-    let task_type = T_task();
-    let taskptr_type = T_ptr(task_type);
-
-    let llmod = str::as_buf("rust_out", {|buf|
-        llvm::LLVMModuleCreateWithNameInContext
-            (buf, llvm::LLVMGetGlobalContext())
-    });
-    let _: () =
-        str::as_buf(x86::get_data_layout(),
-                    {|buf| llvm::LLVMSetDataLayout(llmod, buf) });
-    let _: () =
-        str::as_buf(x86::get_target_triple(),
-                    {|buf| llvm::LLVMSetTarget(llmod, buf) });
-    mk_target_data(x86::get_data_layout());
-    declare_intrinsics(llmod);
-    let _: () =
-        str::as_buf(x86::get_module_asm(),
-                    {|buf| llvm::LLVMSetModuleInlineAsm(llmod, buf) });
-    make_glues(llmod, taskptr_type);
-    link::write::run_passes(sess, llmod, output);
-}
-
 fn create_module_map(ccx: @crate_ctxt) -> ValueRef {
     let elttype = T_struct([T_int(), T_int()]);
     let maptype = T_array(elttype, ccx.module_data.size() + 1u);
@@ -6183,7 +6154,6 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
     tn.associate("taskptr", taskptr_type);
     let tydesc_type = T_tydesc(taskptr_type);
     tn.associate("tydesc", tydesc_type);
-    let glues = make_glues(llmod, taskptr_type);
     let hasher = ty::hash_ty;
     let eqer = ty::eq_ty;
     let tag_sizes = map::mk_hashmap::<ty::t, uint>(hasher, eqer);
@@ -6212,7 +6182,6 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
           tydescs: tydescs,
           module_data: new_str_hash::<ValueRef>(),
           lltypes: lltypes,
-          glues: glues,
           names: namegen(0),
           sha: sha,
           type_sha1s: sha1s,
diff --git a/src/comp/middle/trans_common.rs b/src/comp/middle/trans_common.rs
index eb6b6c9f311..d001abdac84 100644
--- a/src/comp/middle/trans_common.rs
+++ b/src/comp/middle/trans_common.rs
@@ -41,8 +41,6 @@ obj namegen(mutable i: int) {
 
 type derived_tydesc_info = {lltydesc: ValueRef, escapes: bool};
 
-type glue_fns = {no_op_type_glue: ValueRef};
-
 tag tydesc_kind {
     tk_static; // Static (monomorphic) type descriptor.
     tk_param; // Type parameter.
@@ -111,7 +109,6 @@ type crate_ctxt =
      tydescs: hashmap<ty::t, @tydesc_info>,
      module_data: hashmap<str, ValueRef>,
      lltypes: hashmap<ty::t, TypeRef>,
-     glues: @glue_fns,
      names: namegen,
      sha: std::sha1::sha1,
      type_sha1s: hashmap<ty::t, str>,