提交 9dd185c2 编写于 作者: C Corey Richardson

middle: trans: context: remove dead code

上级 e53f48be
......@@ -20,7 +20,6 @@
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 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 @@ pub fn builder<'a>(&'a self) -> Builder<'a> {
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()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册