Skip to content

Commit 9dd185c

Browse files
committed
middle: trans: context: remove dead code
1 parent e53f48b commit 9dd185c

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

src/librustc/middle/trans/context.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ use middle::resolve;
2020
use middle::trans::adt;
2121
use middle::trans::base;
2222
use middle::trans::builder::Builder;
23-
use middle::trans::common::{C_i32, C_null};
2423
use middle::trans::common::{mono_id,ExternMap,tydesc_info,BuilderRef_res,Stats};
2524
use middle::trans::debuginfo;
2625
use middle::trans::type_::Type;
@@ -30,7 +29,6 @@ use util::nodemap::{NodeMap, NodeSet, DefIdMap};
3029

3130
use std::cell::{Cell, RefCell};
3231
use std::c_str::ToCStr;
33-
use std::libc::c_uint;
3432
use std::ptr;
3533
use collections::{HashMap, HashSet};
3634
use syntax::ast;
@@ -232,36 +230,6 @@ impl CrateContext {
232230
Builder::new(self)
233231
}
234232

235-
pub fn const_inbounds_gepi(&self,
236-
pointer: ValueRef,
237-
indices: &[uint]) -> ValueRef {
238-
debug!("const_inbounds_gepi: pointer={} indices={:?}",
239-
self.tn.val_to_str(pointer), indices);
240-
let v: Vec<ValueRef> =
241-
indices.iter().map(|i| C_i32(self, *i as i32)).collect();
242-
unsafe {
243-
llvm::LLVMConstInBoundsGEP(pointer,
244-
v.as_ptr(),
245-
indices.len() as c_uint)
246-
}
247-
}
248-
249-
pub fn offsetof_gep(&self,
250-
llptr_ty: Type,
251-
indices: &[uint]) -> ValueRef {
252-
/*!
253-
* Returns the offset of applying the given GEP indices
254-
* to an instance of `llptr_ty`. Similar to `offsetof` in C,
255-
* except that `llptr_ty` must be a pointer type.
256-
*/
257-
258-
unsafe {
259-
let null = C_null(llptr_ty);
260-
llvm::LLVMConstPtrToInt(self.const_inbounds_gepi(null, indices),
261-
self.int_type.to_ref())
262-
}
263-
}
264-
265233
pub fn tydesc_type(&self) -> Type {
266234
self.tn.find_type("tydesc").unwrap()
267235
}

0 commit comments

Comments
 (0)