Move what's left of metadata::cwriter into middle::trans
This commit is contained in:
parent
45efb1f02a
commit
df2cfac07f
5 changed files with 17 additions and 15 deletions
|
|
@ -15,16 +15,6 @@ fn C_postr(&str s) -> ValueRef {
|
|||
ret llvm::LLVMConstString(str::buf(s), str::byte_len(s), False);
|
||||
}
|
||||
|
||||
fn write_metadata(&@trans::crate_ctxt cx, &@crate crate) {
|
||||
if (!cx.sess.get_opts().shared) { ret; }
|
||||
auto llmeta = C_postr(encoder::encode_metadata(cx, crate));
|
||||
auto llconst = trans::C_struct([llmeta]);
|
||||
auto llglobal =
|
||||
llvm::LLVMAddGlobal(cx.llmod, trans::val_ty(llconst),
|
||||
str::buf("rust_metadata"));
|
||||
llvm::LLVMSetInitializer(llglobal, llconst);
|
||||
llvm::LLVMSetSection(llglobal, str::buf(x86::get_meta_sect_name()));
|
||||
}
|
||||
|
||||
//
|
||||
// Local Variables:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue