Skip to content

Commit

Permalink
middle: trans: common: remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
emberian committed Apr 2, 2014
1 parent 8f385fc commit e53f48b
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions src/librustc/middle/trans/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use middle::trans::datum;
use middle::trans::datum::{Datum, Lvalue};
use middle::trans::debuginfo;
use middle::trans::type_::Type;
use middle::ty::substs;
use middle::ty;
use middle::typeck;
use util::ppaux::Repr;
Expand Down Expand Up @@ -456,14 +455,6 @@ impl<'a> Block<'a> {
e.repr(self.tcx())
}

pub fn expr_is_lval(&self, e: &ast::Expr) -> bool {
ty::expr_is_lval(self.tcx(), self.ccx().maps.method_map, e)
}

pub fn expr_kind(&self, e: &ast::Expr) -> ty::ExprKind {
ty::expr_kind(self.tcx(), self.ccx().maps.method_map, e)
}

pub fn def(&self, nid: ast::NodeId) -> ast::Def {
match self.tcx().def_map.borrow().find(&nid) {
Some(&v) => v,
Expand Down Expand Up @@ -504,13 +495,6 @@ pub fn rslt<'a>(bcx: &'a Block<'a>, val: ValueRef) -> Result<'a> {
}
}

impl<'a> Result<'a> {
pub fn unpack(&self, bcx: &mut &'a Block<'a>) -> ValueRef {
*bcx = self.bcx;
return self.val;
}
}

pub fn val_ty(v: ValueRef) -> Type {
unsafe {
Type::from_ref(llvm::LLVMTypeOf(v))
Expand Down Expand Up @@ -749,22 +733,6 @@ pub struct mono_id_ {

pub type mono_id = @mono_id_;

pub fn umax(cx: &Block, a: ValueRef, b: ValueRef) -> ValueRef {
let cond = build::ICmp(cx, lib::llvm::IntULT, a, b);
return build::Select(cx, cond, b, a);
}

pub fn umin(cx: &Block, a: ValueRef, b: ValueRef) -> ValueRef {
let cond = build::ICmp(cx, lib::llvm::IntULT, a, b);
return build::Select(cx, cond, a, b);
}

pub fn align_to(cx: &Block, off: ValueRef, align: ValueRef) -> ValueRef {
let mask = build::Sub(cx, align, C_int(cx.ccx(), 1));
let bumped = build::Add(cx, off, mask);
return build::And(cx, bumped, build::Not(cx, mask));
}

pub fn monomorphize_type(bcx: &Block, t: ty::t) -> ty::t {
match bcx.fcx.param_substs {
Some(substs) => {
Expand Down Expand Up @@ -928,14 +896,6 @@ pub fn find_vtable(tcx: &ty::ctxt,
param_bounds.get(n_bound).clone()
}

pub fn dummy_substs(tps: Vec<ty::t> ) -> ty::substs {
substs {
regions: ty::ErasedRegions,
self_ty: None,
tps: tps
}
}

pub fn filename_and_line_num_from_span(bcx: &Block, span: Span)
-> (ValueRef, ValueRef) {
let loc = bcx.sess().codemap().lookup_char_pos(span.lo);
Expand Down

0 comments on commit e53f48b

Please sign in to comment.