core: Rename str::from_cstr et. al to from_buf

This commit is contained in:
Brian Anderson
2012-03-14 14:02:07 -07:00
parent 9e480708a2
commit 3a2df84d89
4 changed files with 26 additions and 26 deletions

View File

@@ -27,7 +27,7 @@ fn llvm_err(sess: session, msg: str) -> ! unsafe {
let buf = llvm::LLVMRustGetLastError();
if buf == ptr::null() {
sess.fatal(msg);
} else { sess.fatal(msg + ": " + str::from_cstr(buf)); }
} else { sess.fatal(msg + ": " + str::from_buf(buf)); }
}
fn load_intrinsics_bc(sess: session) -> option<ModuleRef> {

View File

@@ -216,7 +216,7 @@ fn get_metadata_section(sess: session::session,
let si = mk_section_iter(of.llof);
while llvm::LLVMIsSectionIteratorAtEnd(of.llof, si.llsi) == False {
let name_buf = llvm::LLVMGetSectionName(si.llsi);
let name = unsafe { str::from_cstr(name_buf) };
let name = unsafe { str::from_buf(name_buf) };
if str::eq(name, sess.targ_cfg.target_strs.meta_sect_name) {
let cbuf = llvm::LLVMGetSectionContents(si.llsi);
let csz = llvm::LLVMGetSectionSize(si.llsi) as uint;