Move the glue asm code to a .o file. This reduces how much asm we print

in each "translation unit".
This commit is contained in:
Rafael Ávila de Espíndola 2011-03-08 15:32:42 -05:00 committed by Graydon Hoare
parent 35bee753de
commit 55c80e763b
4 changed files with 67 additions and 6 deletions

37
src/comp/glue.rc Normal file
View file

@ -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:

11
src/comp/glue/glue.rs Normal file
View file

@ -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));
}

View file

@ -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);