Skip to content

Commit 1da2670

Browse files
committed
rustc_codegen_llvm: remove #![allow(dead_code)] from llvm.
1 parent 50d7642 commit 1da2670

File tree

3 files changed

+2
-37
lines changed

3 files changed

+2
-37
lines changed

src/librustc_codegen_llvm/llvm/archive_ro.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ pub struct ArchiveRO {
2525
unsafe impl Send for ArchiveRO {}
2626

2727
pub struct Iter<'a> {
28-
archive: &'a ArchiveRO,
2928
ptr: super::ArchiveIteratorRef,
29+
_data: marker::PhantomData<&'a ArchiveRO>,
3030
}
3131

3232
pub struct Child<'a> {
@@ -73,7 +73,7 @@ impl ArchiveRO {
7373
unsafe {
7474
Iter {
7575
ptr: super::LLVMRustArchiveIteratorNew(self.ptr),
76-
archive: self,
76+
_data: marker::PhantomData,
7777
}
7878
}
7979
}

src/librustc_codegen_llvm/llvm/ffi.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,8 +392,6 @@ extern { pub type PassManagerBuilder_opaque; }
392392
pub type PassManagerBuilderRef = *mut PassManagerBuilder_opaque;
393393
extern { pub type Use_opaque; }
394394
pub type UseRef = *mut Use_opaque;
395-
extern { pub type TargetData_opaque; }
396-
pub type TargetDataRef = *mut TargetData_opaque;
397395
extern { pub type ObjectFile_opaque; }
398396
pub type ObjectFileRef = *mut ObjectFile_opaque;
399397
extern { pub type SectionIterator_opaque; }
@@ -1264,12 +1262,6 @@ extern "C" {
12641262
/// Writes a module to the specified path. Returns 0 on success.
12651263
pub fn LLVMWriteBitcodeToFile(M: &Module, Path: *const c_char) -> c_int;
12661264

1267-
/// Creates target data from a target layout string.
1268-
pub fn LLVMCreateTargetData(StringRep: *const c_char) -> TargetDataRef;
1269-
1270-
/// Disposes target data.
1271-
pub fn LLVMDisposeTargetData(TD: TargetDataRef);
1272-
12731265
/// Creates a pass manager.
12741266
pub fn LLVMCreatePassManager() -> PassManagerRef;
12751267

src/librustc_codegen_llvm/llvm/mod.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![allow(non_upper_case_globals)]
1212
#![allow(non_camel_case_types)]
1313
#![allow(non_snake_case)]
14-
#![allow(dead_code)]
1514
#![deny(bare_trait_objects)]
1615

1716
pub use self::IntPredicate::*;
@@ -177,25 +176,6 @@ impl Attribute {
177176
}
178177
}
179178

180-
// Memory-managed interface to target data.
181-
182-
struct TargetData {
183-
lltd: TargetDataRef,
184-
}
185-
186-
impl Drop for TargetData {
187-
fn drop(&mut self) {
188-
unsafe {
189-
LLVMDisposeTargetData(self.lltd);
190-
}
191-
}
192-
}
193-
194-
fn mk_target_data(string_rep: &str) -> TargetData {
195-
let string_rep = CString::new(string_rep).unwrap();
196-
TargetData { lltd: unsafe { LLVMCreateTargetData(string_rep.as_ptr()) } }
197-
}
198-
199179
// Memory-managed interface to object files.
200180

201181
pub struct ObjectFile {
@@ -254,13 +234,6 @@ pub fn get_param(llfn: ValueRef, index: c_uint) -> ValueRef {
254234
}
255235
}
256236

257-
fn get_params(llfn: ValueRef) -> Vec<ValueRef> {
258-
unsafe {
259-
let num_params = LLVMCountParams(llfn);
260-
(0..num_params).map(|idx| LLVMGetParam(llfn, idx)).collect()
261-
}
262-
}
263-
264237
pub fn build_string<F>(f: F) -> Option<String>
265238
where F: FnOnce(RustStringRef)
266239
{

0 commit comments

Comments
 (0)