about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCorey Richardson <corey@octayn.net>2014-04-01 10:29:37 -0400
committerCorey Richardson <corey@octayn.net>2014-04-02 11:17:22 -0400
commitf9973103c59c13026f03b499fd91ef5aa7196da6 (patch)
tree9e3ec37a1c68740982daba63fbc0ed11c91fccb9
parent9dd185c25517e568d7fd85df030e848deec655d0 (diff)
middle: trans: datum: remove dead code
-rw-r--r--src/librustc/middle/trans/datum.rs48
1 files changed, 2 insertions, 46 deletions
diff --git a/src/librustc/middle/trans/datum.rs b/src/librustc/middle/trans/datum.rs
index 9f48e4714d6..500a36c5dee 100644
--- a/src/librustc/middle/trans/datum.rs
+++ b/src/librustc/middle/trans/datum.rs
@@ -24,12 +24,10 @@ use middle::trans::expr;
 use middle::trans::glue;
 use middle::trans::tvec;
 use middle::trans::type_of;
-use middle::trans::write_guard;
 use middle::ty;
 use util::ppaux::{ty_to_str};
 
 use syntax::ast;
-use syntax::codemap::Span;
 
 /**
  * A `Datum` encapsulates the result of evaluating an expression.  It
@@ -160,10 +158,6 @@ pub fn rvalue_scratch_datum(bcx: &Block,
     Datum(scratch, ty, Rvalue(ByRef))
 }
 
-pub fn is_by_value_type(ccx: &CrateContext, ty: ty::t) -> bool {
-    appropriate_rvalue_mode(ccx, ty) == ByValue
-}
-
 pub fn appropriate_rvalue_mode(ccx: &CrateContext, ty: ty::t) -> RvalueMode {
     /*!
      * Indicates the "appropriate" mode for this value,
@@ -389,10 +383,7 @@ impl Datum<Expr> {
         }
     }
 
-    pub fn is_by_ref(&self) -> bool {
-        self.kind.is_by_ref()
-    }
-
+    #[allow(dead_code)] // potentially useful
     pub fn assert_lvalue(self, bcx: &Block) -> Datum<Lvalue> {
         /*!
          * Asserts that this datum *is* an lvalue and returns it.
@@ -632,6 +623,7 @@ impl<K:KindOps> Datum<K> {
         glue::take_ty(bcx, dst, self.ty)
     }
 
+    #[allow(dead_code)] // useful for debugging
     pub fn to_str(&self, ccx: &CrateContext) -> ~str {
         format!("Datum({}, {}, {:?})",
              ccx.tn.val_to_str(self.val),
@@ -645,16 +637,6 @@ impl<K:KindOps> Datum<K> {
         appropriate_rvalue_mode(ccx, self.ty)
     }
 
-    pub fn root_and_write_guard<'a>(
-                                &self,
-                                bcx: &'a Block<'a>,
-                                span: Span,
-                                expr_id: ast::NodeId,
-                                derefs: uint)
-                                -> &'a Block<'a> {
-        write_guard::root_and_write_guard(self, bcx, span, expr_id, derefs)
-    }
-
     pub fn to_llscalarish<'a>(self, bcx: &'a Block<'a>) -> ValueRef {
         /*!
          * Converts `self` into a by-value `ValueRef`. Consumes this
@@ -688,16 +670,6 @@ impl<'a, K:KindOps> DatumBlock<'a, K> {
 }
 
 impl<'a> DatumBlock<'a, Expr> {
-    pub fn assert_by_ref(self) -> DatumBlock<'a, Expr> {
-        assert!(self.datum.kind.is_by_ref());
-        self
-    }
-
-    pub fn store_to(self, dst: ValueRef) -> &'a Block<'a> {
-        let DatumBlock { bcx, datum } = self;
-        datum.store_to(bcx, dst)
-    }
-
     pub fn store_to_dest(self,
                          dest: expr::Dest,
                          expr_id: ast::NodeId) -> &'a Block<'a> {
@@ -705,22 +677,6 @@ impl<'a> DatumBlock<'a, Expr> {
         datum.store_to_dest(bcx, dest, expr_id)
     }
 
-    pub fn shallow_copy(self, dst: ValueRef) -> &'a Block<'a> {
-        self.datum.shallow_copy(self.bcx, dst)
-    }
-
-    pub fn ccx(&self) -> &'a CrateContext {
-        self.bcx.ccx()
-    }
-
-    pub fn tcx(&self) -> &'a ty::ctxt {
-        self.bcx.tcx()
-    }
-
-    pub fn to_str(&self) -> ~str {
-        self.datum.to_str(self.ccx())
-    }
-
     pub fn to_llbool(self) -> Result<'a> {
         let DatumBlock { datum, bcx } = self;
         rslt(bcx, datum.to_llbool(bcx))