Skip to content

Commit 984e830

Browse files
committed
---
yaml --- r: 110399 b: refs/heads/try c: f997310 h: refs/heads/master i: 110397: f59e9df 110395: b919f4a 110391: 7e94692 110383: a203072 110367: b2404ae 110335: 34abb45 v: v3
1 parent 4e6b16d commit 984e830

File tree

2 files changed

+3
-47
lines changed

2 files changed

+3
-47
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: e415c25bcd81dc1f9a5a3d25d9b48ed2d545336b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: c7fac4471201977fdb1c0c0a26c87287e12dc644
5-
refs/heads/try: 9dd185c25517e568d7fd85df030e848deec655d0
5+
refs/heads/try: f9973103c59c13026f03b499fd91ef5aa7196da6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/trans/datum.rs

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ use middle::trans::expr;
2424
use middle::trans::glue;
2525
use middle::trans::tvec;
2626
use middle::trans::type_of;
27-
use middle::trans::write_guard;
2827
use middle::ty;
2928
use util::ppaux::{ty_to_str};
3029

3130
use syntax::ast;
32-
use syntax::codemap::Span;
3331

3432
/**
3533
* A `Datum` encapsulates the result of evaluating an expression. It
@@ -160,10 +158,6 @@ pub fn rvalue_scratch_datum(bcx: &Block,
160158
Datum(scratch, ty, Rvalue(ByRef))
161159
}
162160

163-
pub fn is_by_value_type(ccx: &CrateContext, ty: ty::t) -> bool {
164-
appropriate_rvalue_mode(ccx, ty) == ByValue
165-
}
166-
167161
pub fn appropriate_rvalue_mode(ccx: &CrateContext, ty: ty::t) -> RvalueMode {
168162
/*!
169163
* Indicates the "appropriate" mode for this value,
@@ -389,10 +383,7 @@ impl Datum<Expr> {
389383
}
390384
}
391385

392-
pub fn is_by_ref(&self) -> bool {
393-
self.kind.is_by_ref()
394-
}
395-
386+
#[allow(dead_code)] // potentially useful
396387
pub fn assert_lvalue(self, bcx: &Block) -> Datum<Lvalue> {
397388
/*!
398389
* Asserts that this datum *is* an lvalue and returns it.
@@ -632,6 +623,7 @@ impl<K:KindOps> Datum<K> {
632623
glue::take_ty(bcx, dst, self.ty)
633624
}
634625

626+
#[allow(dead_code)] // useful for debugging
635627
pub fn to_str(&self, ccx: &CrateContext) -> ~str {
636628
format!("Datum({}, {}, {:?})",
637629
ccx.tn.val_to_str(self.val),
@@ -645,16 +637,6 @@ impl<K:KindOps> Datum<K> {
645637
appropriate_rvalue_mode(ccx, self.ty)
646638
}
647639

648-
pub fn root_and_write_guard<'a>(
649-
&self,
650-
bcx: &'a Block<'a>,
651-
span: Span,
652-
expr_id: ast::NodeId,
653-
derefs: uint)
654-
-> &'a Block<'a> {
655-
write_guard::root_and_write_guard(self, bcx, span, expr_id, derefs)
656-
}
657-
658640
pub fn to_llscalarish<'a>(self, bcx: &'a Block<'a>) -> ValueRef {
659641
/*!
660642
* Converts `self` into a by-value `ValueRef`. Consumes this
@@ -688,39 +670,13 @@ impl<'a, K:KindOps> DatumBlock<'a, K> {
688670
}
689671

690672
impl<'a> DatumBlock<'a, Expr> {
691-
pub fn assert_by_ref(self) -> DatumBlock<'a, Expr> {
692-
assert!(self.datum.kind.is_by_ref());
693-
self
694-
}
695-
696-
pub fn store_to(self, dst: ValueRef) -> &'a Block<'a> {
697-
let DatumBlock { bcx, datum } = self;
698-
datum.store_to(bcx, dst)
699-
}
700-
701673
pub fn store_to_dest(self,
702674
dest: expr::Dest,
703675
expr_id: ast::NodeId) -> &'a Block<'a> {
704676
let DatumBlock { bcx, datum } = self;
705677
datum.store_to_dest(bcx, dest, expr_id)
706678
}
707679

708-
pub fn shallow_copy(self, dst: ValueRef) -> &'a Block<'a> {
709-
self.datum.shallow_copy(self.bcx, dst)
710-
}
711-
712-
pub fn ccx(&self) -> &'a CrateContext {
713-
self.bcx.ccx()
714-
}
715-
716-
pub fn tcx(&self) -> &'a ty::ctxt {
717-
self.bcx.tcx()
718-
}
719-
720-
pub fn to_str(&self) -> ~str {
721-
self.datum.to_str(self.ccx())
722-
}
723-
724680
pub fn to_llbool(self) -> Result<'a> {
725681
let DatumBlock { datum, bcx } = self;
726682
rslt(bcx, datum.to_llbool(bcx))

0 commit comments

Comments
 (0)