(FIX) Change encoder::encode_metadata to return a [u8] (which will become an LLVM string)
This commit is contained in:
parent
5847cf0367
commit
4d7c297bea
2 changed files with 3 additions and 3 deletions
|
|
@ -662,7 +662,7 @@ fn encode_hash(ebml_w: ebml::writer, hash: str) {
|
|||
ebml::end_tag(ebml_w);
|
||||
}
|
||||
|
||||
fn encode_metadata(cx: @crate_ctxt, crate: @crate) -> str {
|
||||
fn encode_metadata(cx: @crate_ctxt, crate: @crate) -> [u8] {
|
||||
|
||||
let abbrevs = ty::new_ty_hash();
|
||||
let ecx = @{ccx: cx, type_abbrevs: abbrevs};
|
||||
|
|
@ -695,7 +695,7 @@ fn encode_metadata(cx: @crate_ctxt, crate: @crate) -> str {
|
|||
// Pad this, since something (LLVM, presumably) is cutting off the
|
||||
// remaining % 4 bytes.
|
||||
buf_w.write([0u8, 0u8, 0u8, 0u8]);
|
||||
io::mem_buffer_str(buf)
|
||||
io::mem_buffer_buf(buf)
|
||||
}
|
||||
|
||||
// Get the encoded string for a type
|
||||
|
|
|
|||
|
|
@ -5419,7 +5419,7 @@ fn fill_crate_map(ccx: @crate_ctxt, map: ValueRef) {
|
|||
|
||||
fn write_metadata(cx: @crate_ctxt, crate: @ast::crate) {
|
||||
if !cx.sess.building_library { ret; }
|
||||
let llmeta = C_postr(metadata::encoder::encode_metadata(cx, crate));
|
||||
let llmeta = C_bytes(metadata::encoder::encode_metadata(cx, crate));
|
||||
let llconst = trans_common::C_struct([llmeta]);
|
||||
let llglobal =
|
||||
str::as_buf("rust_metadata",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue