diff --git a/src/librustc_codegen_llvm/llvm/archive_ro.rs b/src/librustc_codegen_llvm/llvm/archive_ro.rs index 116f16de324..e25f6691961 100644 --- a/src/librustc_codegen_llvm/llvm/archive_ro.rs +++ b/src/librustc_codegen_llvm/llvm/archive_ro.rs @@ -25,8 +25,8 @@ pub struct ArchiveRO { unsafe impl Send for ArchiveRO {} pub struct Iter<'a> { - archive: &'a ArchiveRO, ptr: super::ArchiveIteratorRef, + _data: marker::PhantomData<&'a ArchiveRO>, } pub struct Child<'a> { @@ -73,7 +73,7 @@ impl ArchiveRO { unsafe { Iter { ptr: super::LLVMRustArchiveIteratorNew(self.ptr), - archive: self, + _data: marker::PhantomData, } } } diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index 613cc36b47f..fcecb5c88c5 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -392,8 +392,6 @@ extern { pub type PassManagerBuilder_opaque; } pub type PassManagerBuilderRef = *mut PassManagerBuilder_opaque; extern { pub type Use_opaque; } pub type UseRef = *mut Use_opaque; -extern { pub type TargetData_opaque; } -pub type TargetDataRef = *mut TargetData_opaque; extern { pub type ObjectFile_opaque; } pub type ObjectFileRef = *mut ObjectFile_opaque; extern { pub type SectionIterator_opaque; } @@ -1264,12 +1262,6 @@ extern "C" { /// Writes a module to the specified path. Returns 0 on success. pub fn LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int; - /// Creates target data from a target layout string. - pub fn LLVMCreateTargetData(StringRep: *const c_char) -> TargetDataRef; - - /// Disposes target data. - pub fn LLVMDisposeTargetData(TD: TargetDataRef); - /// Creates a pass manager. pub fn LLVMCreatePassManager() -> PassManagerRef; diff --git a/src/librustc_codegen_llvm/llvm/mod.rs b/src/librustc_codegen_llvm/llvm/mod.rs index 37f1bf5c1e7..98d8932e612 100644 --- a/src/librustc_codegen_llvm/llvm/mod.rs +++ b/src/librustc_codegen_llvm/llvm/mod.rs @@ -11,7 +11,6 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] -#![allow(dead_code)] #![deny(bare_trait_objects)] pub use self::IntPredicate::*; @@ -177,25 +176,6 @@ impl Attribute { } } -// Memory-managed interface to target data. - -struct TargetData { - lltd: TargetDataRef, -} - -impl Drop for TargetData { - fn drop(&mut self) { - unsafe { - LLVMDisposeTargetData(self.lltd); - } - } -} - -fn mk_target_data(string_rep: &str) -> TargetData { - let string_rep = CString::new(string_rep).unwrap(); - TargetData { lltd: unsafe { LLVMCreateTargetData(string_rep.as_ptr()) } } -} - // Memory-managed interface to object files. pub struct ObjectFile { @@ -254,13 +234,6 @@ pub fn get_param(llfn: ValueRef, index: c_uint) -> ValueRef { } } -fn get_params(llfn: ValueRef) -> Vec { - unsafe { - let num_params = LLVMCountParams(llfn); - (0..num_params).map(|idx| LLVMGetParam(llfn, idx)).collect() - } -} - pub fn build_string(f: F) -> Option where F: FnOnce(RustStringRef) {