aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
authorRafael Ávila de Espíndola <[email protected]>2011-03-08 15:32:42 -0500
committerGraydon Hoare <[email protected]>2011-03-08 13:08:31 -0800
commit55c80e763bfd850682b3217fcfc5cdb516eafae0 (patch)
tree195be92a5e5de795986703c968e534262f61b37c /src/comp
parentrustc: Pass explicit type substitutions to later passes (diff)
downloadrust-55c80e763bfd850682b3217fcfc5cdb516eafae0.tar.xz
rust-55c80e763bfd850682b3217fcfc5cdb516eafae0.zip
Move the glue asm code to a .o file. This reduces how much asm we print
in each "translation unit".
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/glue.rc37
-rw-r--r--src/comp/glue/glue.rs11
-rw-r--r--src/comp/middle/trans.rs2
3 files changed, 48 insertions, 2 deletions
diff --git a/src/comp/glue.rc b/src/comp/glue.rc
new file mode 100644
index 00000000..1048341a
--- /dev/null
+++ b/src/comp/glue.rc
@@ -0,0 +1,37 @@
+// -*- rust -*-
+
+use std;
+
+mod front {
+ mod ast;
+}
+
+mod middle {
+ mod ty;
+}
+
+mod driver {
+ mod session;
+}
+
+mod glue {
+ mod glue;
+}
+
+mod back {
+ mod abi;
+ mod x86;
+}
+
+mod util {
+ mod common;
+}
+
+
+// Local Variables:
+// fill-column: 78;
+// indent-tabs-mode: nil
+// c-basic-offset: 4
+// buffer-file-coding-system: utf-8-unix
+// compile-command: "make -k -C .. 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
+// End:
diff --git a/src/comp/glue/glue.rs b/src/comp/glue/glue.rs
new file mode 100644
index 00000000..96bdba76
--- /dev/null
+++ b/src/comp/glue/glue.rs
@@ -0,0 +1,11 @@
+import back.x86;
+import std._str;
+import std._vec;
+import std.os.libc;
+
+fn main(vec[str] args) {
+ auto module_asm = x86.get_module_asm() + "\n";
+ auto bytes = _str.bytes(module_asm);
+ auto b = _vec.buf[u8](bytes);
+ libc.write(1, b, _vec.len[u8](bytes));
+}
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 7457a532..e4512a47 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -5708,8 +5708,6 @@ fn trans_crate(session.session sess, @ast.crate crate, str output,
let ValueRef crate_ptr =
llvm.LLVMAddGlobal(llmod, T_crate(tn), _str.buf("rust_crate"));
- llvm.LLVMSetModuleInlineAsm(llmod, _str.buf(x86.get_module_asm()));
-
auto intrinsics = declare_intrinsics(llmod);
auto glues = make_glues(llmod, tn);