about summary refs log tree commit diff
diff options
context:
space:
mode:
authorIrina Popa <irinagpopa@gmail.com>2018-07-04 19:16:13 +0300
committerIrina Popa <irinagpopa@gmail.com>2018-07-30 19:32:20 +0300
commit1da26707d6ef6eb703001157a7a9a7bd20d17c83 (patch)
tree6df2cd73b71fc6cf7073145293a426763f9dd7aa
parent50d764298e1b7fdc193f0f66c1a692015c852227 (diff)
downloadrust-1da26707d6ef6eb703001157a7a9a7bd20d17c83.tar.gz
rust-1da26707d6ef6eb703001157a7a9a7bd20d17c83.zip
rustc_codegen_llvm: remove #![allow(dead_code)] from llvm.
-rw-r--r--src/librustc_codegen_llvm/llvm/archive_ro.rs4
-rw-r--r--src/librustc_codegen_llvm/llvm/ffi.rs8
-rw-r--r--src/librustc_codegen_llvm/llvm/mod.rs27
3 files changed, 2 insertions, 37 deletions
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<ValueRef> {
-    unsafe {
-        let num_params = LLVMCountParams(llfn);
-        (0..num_params).map(|idx| LLVMGetParam(llfn, idx)).collect()
-    }
-}
-
 pub fn build_string<F>(f: F) -> Option<String>
     where F: FnOnce(RustStringRef)
 {