diff options
Diffstat (limited to 'src/librustc_codegen_llvm/llvm/mod.rs')
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/mod.rs | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/src/librustc_codegen_llvm/llvm/mod.rs b/src/librustc_codegen_llvm/llvm/mod.rs index d2d41876239..975756753d6 100644 --- a/src/librustc_codegen_llvm/llvm/mod.rs +++ b/src/librustc_codegen_llvm/llvm/mod.rs @@ -10,11 +10,11 @@ pub use self::Linkage::*; use std::str::FromStr; use std::string::FromUtf8Error; -use std::slice; use std::ffi::CStr; use std::cell::RefCell; -use libc::{c_uint, c_char, size_t}; +use libc::c_uint; use rustc_data_structures::small_c_str::SmallCStr; +use rustc_llvm::RustString; pub mod archive_ro; pub mod diagnostic; @@ -81,21 +81,6 @@ impl FromStr for ArchiveKind { } } -#[repr(C)] -pub struct RustString { - bytes: RefCell<Vec<u8>>, -} - -/// Appending to a Rust string -- used by RawRustStringOstream. -#[no_mangle] -pub unsafe extern "C" fn LLVMRustStringWriteImpl(sr: &RustString, - ptr: *const c_char, - size: size_t) { - let slice = slice::from_raw_parts(ptr as *const u8, size as usize); - - sr.bytes.borrow_mut().extend_from_slice(slice); -} - pub fn SetInstructionCallConv(instr: &'a Value, cc: CallConv) { unsafe { LLVMSetInstructionCallConv(instr, cc as c_uint); |
