middle: trans: context: remove dead code

This commit is contained in:
Corey Richardson 2014-04-01 10:28:56 -04:00
parent e53f48be34
commit 9dd185c255
1 changed files with 0 additions and 32 deletions

View File

@ -20,7 +20,6 @@ use middle::resolve;
use middle::trans::adt;
use middle::trans::base;
use middle::trans::builder::Builder;
use middle::trans::common::{C_i32, C_null};
use middle::trans::common::{mono_id,ExternMap,tydesc_info,BuilderRef_res,Stats};
use middle::trans::debuginfo;
use middle::trans::type_::Type;
@ -30,7 +29,6 @@ use util::nodemap::{NodeMap, NodeSet, DefIdMap};
use std::cell::{Cell, RefCell};
use std::c_str::ToCStr;
use std::libc::c_uint;
use std::ptr;
use collections::{HashMap, HashSet};
use syntax::ast;
@ -232,36 +230,6 @@ impl CrateContext {
Builder::new(self)
}
pub fn const_inbounds_gepi(&self,
pointer: ValueRef,
indices: &[uint]) -> ValueRef {
debug!("const_inbounds_gepi: pointer={} indices={:?}",
self.tn.val_to_str(pointer), indices);
let v: Vec<ValueRef> =
indices.iter().map(|i| C_i32(self, *i as i32)).collect();
unsafe {
llvm::LLVMConstInBoundsGEP(pointer,
v.as_ptr(),
indices.len() as c_uint)
}
}
pub fn offsetof_gep(&self,
llptr_ty: Type,
indices: &[uint]) -> ValueRef {
/*!
* Returns the offset of applying the given GEP indices
* to an instance of `llptr_ty`. Similar to `offsetof` in C,
* except that `llptr_ty` must be a pointer type.
*/
unsafe {
let null = C_null(llptr_ty);
llvm::LLVMConstPtrToInt(self.const_inbounds_gepi(null, indices),
self.int_type.to_ref())
}
}
pub fn tydesc_type(&self) -> Type {
self.tn.find_type("tydesc").unwrap()
}