diff options
| author | Kevin Cantu <me@kevincantu.org> | 2012-01-25 22:27:29 -0800 |
|---|---|---|
| committer | Kevin Cantu <me@kevincantu.org> | 2012-01-25 22:27:29 -0800 |
| commit | 4d7c297beaa4326d8c7dda029aeec264616cfca6 (patch) | |
| tree | f14eb6bd5a580c375162115e3244acb3f9122f8c /src/comp | |
| parent | 5847cf0367287d89377c57a431f38419ec1db008 (diff) | |
| download | rust-4d7c297beaa4326d8c7dda029aeec264616cfca6.tar.gz rust-4d7c297beaa4326d8c7dda029aeec264616cfca6.zip | |
(FIX) Change encoder::encode_metadata to return a [u8] (which will become an LLVM string)
Diffstat (limited to 'src/comp')
| -rw-r--r-- | src/comp/metadata/encoder.rs | 4 | ||||
| -rw-r--r-- | src/comp/middle/trans.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/comp/metadata/encoder.rs b/src/comp/metadata/encoder.rs index cc79e6a2bf0..66da9f7c36d 100644 --- a/src/comp/metadata/encoder.rs +++ b/src/comp/metadata/encoder.rs @@ -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 diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index e0dddd7057b..41fe5f8e19a 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -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", |
