Skip to content

Commit 3255e2b

Browse files
committed
---
yaml --- r: 273879 b: refs/heads/beta c: 913a2b4 h: refs/heads/master i: 273877: 7552346 273875: 6ecc7ce 273871: 3d33e5d
1 parent b79bccc commit 3255e2b

File tree

23 files changed

+117
-572
lines changed

23 files changed

+117
-572
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: f92ce2e9fe56942e0fd6a18d0e11bc4a9bdf8ddd
26+
refs/heads/beta: 913a2b4b0525c75ecf915076c4fd1e16187f8b51
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/configure

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,6 @@ opt inject-std-version 1 "inject the current compiler version of libstd into pro
608608
opt llvm-version-check 1 "check if the LLVM version is supported, build anyway"
609609
opt rustbuild 0 "use the rust and cargo based build system"
610610
opt orbit 0 "get MIR where it belongs - everywhere; most importantly, in orbit"
611-
opt codegen-tests 1 "run the src/test/codegen tests"
612611

613612
# Optimization and debugging options. These may be overridden by the release channel, etc.
614613
opt_nosave optimize 1 "build optimized rust code"
@@ -1498,9 +1497,7 @@ do
14981497
LLVM_INST_DIR=$CFG_LLVM_ROOT
14991498
do_reconfigure=0
15001499
# Check that LLVm FileCheck is available. Needed for the tests
1501-
if [ -z "$CFG_DISABLE_CODEGEN_TESTS" ]; then
1502-
need_cmd $LLVM_INST_DIR/bin/FileCheck
1503-
fi
1500+
need_cmd $LLVM_INST_DIR/bin/FileCheck
15041501
fi
15051502

15061503
if [ ${do_reconfigure} -ne 0 ]

branches/beta/mk/tests.mk

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,11 @@ check-stage$(1)-T-$(2)-H-$(3)-exec: \
305305
check-stage$(1)-T-$(2)-H-$(3)-doc-crates-exec \
306306
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-gdb-exec \
307307
check-stage$(1)-T-$(2)-H-$(3)-debuginfo-lldb-exec \
308+
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
309+
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec \
308310
check-stage$(1)-T-$(2)-H-$(3)-doc-exec \
309311
check-stage$(1)-T-$(2)-H-$(3)-pretty-exec
310312

311-
ifndef CFG_DISABLE_CODEGEN_TESTS
312-
check-stage$(1)-T-$(2)-H-$(3)-exec: \
313-
check-stage$(1)-T-$(2)-H-$(3)-codegen-exec \
314-
check-stage$(1)-T-$(2)-H-$(3)-codegen-units-exec
315-
endif
316-
317313
# Only test the compiler-dependent crates when the target is
318314
# able to build a compiler (when the target triple is in the set of host triples)
319315
ifneq ($$(findstring $(2),$$(CFG_HOST)),)

branches/beta/src/libcore/num/dec2flt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ from_str_float_impl!(f64);
154154
/// for [`f32`] and [`f64`].
155155
///
156156
/// [`FromStr`]: ../str/trait.FromStr.html
157-
/// [`f32`]: ../../std/primitive.f32.html
158-
/// [`f64`]: ../../std/primitive.f64.html
157+
/// [`f32`]: ../primitive.f32.html
158+
/// [`f64`]: ../primitive.f64.html
159159
#[derive(Debug, Clone, PartialEq)]
160160
#[stable(feature = "rust1", since = "1.0.0")]
161161
pub struct ParseFloatError {

branches/beta/src/librustc_const_eval/eval.rs

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,15 @@ pub fn eval_const_expr(tcx: &TyCtxt, e: &Expr) -> ConstVal {
343343
match eval_const_expr_partial(tcx, e, ExprTypeChecked, None) {
344344
Ok(r) => r,
345345
// non-const path still needs to be a fatal error, because enums are funky
346-
Err(ref s) if s.kind == NonConstPath => tcx.sess.span_fatal(s.span, &s.description()),
347346
Err(s) => {
348-
tcx.sess.span_err(s.span, &s.description());
349-
Dummy
347+
match s.kind {
348+
NonConstPath |
349+
UnimplementedConstVal(_) => tcx.sess.span_fatal(s.span, &s.description()),
350+
_ => {
351+
tcx.sess.span_err(s.span, &s.description());
352+
Dummy
353+
}
354+
}
350355
},
351356
}
352357
}
@@ -607,6 +612,7 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>,
607612
const_val => signal!(e, NotOn(const_val)),
608613
}
609614
}
615+
hir::ExprUnary(hir::UnDeref, _) => signal!(e, UnimplementedConstVal("deref operation")),
610616
hir::ExprBinary(op, ref a, ref b) => {
611617
let b_ty = match op.node {
612618
hir::BiShl | hir::BiShr => ty_hint.erase_hint(),
@@ -745,7 +751,7 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>,
745751
if let Some(const_expr) = lookup_variant_by_id(tcx, enum_def, variant_def) {
746752
eval_const_expr_partial(tcx, const_expr, ty_hint, None)?
747753
} else {
748-
signal!(e, NonConstPath);
754+
signal!(e, UnimplementedConstVal("enum variants"));
749755
}
750756
}
751757
Def::Struct(..) => {
@@ -768,6 +774,7 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>,
768774
let callee_val = eval_const_expr_partial(tcx, callee, sub_ty_hint, fn_args)?;
769775
let did = match callee_val {
770776
Function(did) => did,
777+
Struct(_) => signal!(e, UnimplementedConstVal("tuple struct constructors")),
771778
callee => signal!(e, CallOn(callee)),
772779
};
773780
let (decl, result) = if let Some(fn_like) = lookup_const_fn_by_id(tcx, did) {
@@ -798,7 +805,7 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>,
798805
hir::ExprBlock(ref block) => {
799806
match block.expr {
800807
Some(ref expr) => eval_const_expr_partial(tcx, &expr, ty_hint, fn_args)?,
801-
None => bug!(),
808+
None => signal!(e, UnimplementedConstVal("empty block")),
802809
}
803810
}
804811
hir::ExprType(ref e, _) => eval_const_expr_partial(tcx, &e, ty_hint, fn_args)?,
@@ -840,7 +847,8 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>,
840847
},
841848

842849
Str(ref s) if idx as usize >= s.len() => signal!(e, IndexOutOfBounds),
843-
Str(_) => bug!("unimplemented"), // FIXME: return a const char
850+
// FIXME: return a const char
851+
Str(_) => signal!(e, UnimplementedConstVal("indexing into str")),
844852
_ => signal!(e, IndexedNonVec),
845853
}
846854
}
@@ -894,6 +902,7 @@ pub fn eval_const_expr_partial<'tcx>(tcx: &TyCtxt<'tcx>,
894902
signal!(base, ExpectedConstStruct);
895903
}
896904
}
905+
hir::ExprAddrOf(..) => signal!(e, UnimplementedConstVal("address operator")),
897906
_ => signal!(e, MiscCatchAll)
898907
};
899908

@@ -1073,6 +1082,7 @@ fn cast_const_int<'tcx>(tcx: &TyCtxt<'tcx>, val: ConstInt, ty: ty::Ty) -> CastRe
10731082
Ok(Float(val as f64))
10741083
},
10751084
ty::TyFloat(ast::FloatTy::F32) => Ok(Float(val.to_u64().unwrap() as f32 as f64)),
1085+
ty::TyRawPtr(_) => Err(ErrKind::UnimplementedConstVal("casting an address to a raw ptr")),
10761086
_ => Err(CannotCast),
10771087
}
10781088
}
@@ -1094,6 +1104,7 @@ fn cast_const<'tcx>(tcx: &TyCtxt<'tcx>, val: ConstVal, ty: ty::Ty) -> CastResult
10941104
Bool(b) => cast_const_int(tcx, Infer(b as u64), ty),
10951105
Float(f) => cast_const_float(tcx, f, ty),
10961106
Char(c) => cast_const_int(tcx, Infer(c as u64), ty),
1107+
Function(_) => Err(UnimplementedConstVal("casting fn pointers")),
10971108
_ => Err(CannotCast),
10981109
}
10991110
}

branches/beta/src/librustc_data_structures/bitvec.rs

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::iter::FromIterator;
12-
1311
/// A very simple BitVector type.
14-
#[derive(Clone)]
1512
pub struct BitVector {
1613
data: Vec<u64>,
1714
}
@@ -53,9 +50,7 @@ impl BitVector {
5350
pub fn grow(&mut self, num_bits: usize) {
5451
let num_words = u64s(num_bits);
5552
let extra_words = self.data.len() - num_words;
56-
if extra_words > 0 {
57-
self.data.extend((0..extra_words).map(|_| 0));
58-
}
53+
self.data.extend((0..extra_words).map(|_| 0));
5954
}
6055

6156
/// Iterates over indexes of set bits in a sorted order
@@ -98,27 +93,6 @@ impl<'a> Iterator for BitVectorIter<'a> {
9893
}
9994
}
10095

101-
impl FromIterator<bool> for BitVector {
102-
fn from_iter<I>(iter: I) -> BitVector where I: IntoIterator<Item=bool> {
103-
let iter = iter.into_iter();
104-
let (len, _) = iter.size_hint();
105-
// Make the minimum length for the bitvector 64 bits since that's
106-
// the smallest non-zero size anyway.
107-
let len = if len < 64 { 64 } else { len };
108-
let mut bv = BitVector::new(len);
109-
for (idx, val) in iter.enumerate() {
110-
if idx > len {
111-
bv.grow(idx);
112-
}
113-
if val {
114-
bv.insert(idx);
115-
}
116-
}
117-
118-
bv
119-
}
120-
}
121-
12296
/// A "bit matrix" is basically a square matrix of booleans
12397
/// represented as one gigantic bitvector. In other words, it is as if
12498
/// you have N bitvectors, each of length N. Note that `elements` here is `N`/

branches/beta/src/librustc_driver/driver.rs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,10 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
881881
passes.push_pass(box mir::transform::remove_dead_blocks::RemoveDeadBlocks);
882882
passes.push_pass(box mir::transform::type_check::TypeckMir);
883883
passes.push_pass(box mir::transform::simplify_cfg::SimplifyCfg);
884+
// Late passes
885+
passes.push_pass(box mir::transform::no_landing_pads::NoLandingPads);
884886
passes.push_pass(box mir::transform::remove_dead_blocks::RemoveDeadBlocks);
887+
passes.push_pass(box mir::transform::erase_regions::EraseRegions);
885888
// And run everything.
886889
passes.run_passes(tcx, &mut mir_map);
887890
});
@@ -934,25 +937,16 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(sess: &'tcx Session,
934937

935938
/// Run the translation phase to LLVM, after which the AST and analysis can
936939
pub fn phase_4_translate_to_llvm<'tcx>(tcx: &TyCtxt<'tcx>,
937-
mut mir_map: MirMap<'tcx>,
938-
analysis: ty::CrateAnalysis) -> trans::CrateTranslation {
940+
mir_map: MirMap<'tcx>,
941+
analysis: ty::CrateAnalysis)
942+
-> trans::CrateTranslation {
939943
let time_passes = tcx.sess.time_passes();
940944

941945
time(time_passes,
942946
"resolving dependency formats",
943947
|| dependency_format::calculate(&tcx.sess));
944948

945-
// Run the passes that transform the MIR into a more suitable for translation
946-
// to LLVM code.
947-
time(time_passes, "Prepare MIR codegen passes", || {
948-
let mut passes = ::rustc::mir::transform::Passes::new();
949-
passes.push_pass(box mir::transform::no_landing_pads::NoLandingPads);
950-
passes.push_pass(box mir::transform::remove_dead_blocks::RemoveDeadBlocks);
951-
passes.push_pass(box mir::transform::erase_regions::EraseRegions);
952-
passes.push_pass(box mir::transform::break_critical_edges::BreakCriticalEdges);
953-
passes.run_passes(tcx, &mut mir_map);
954-
});
955-
949+
// Option dance to work around the lack of stack once closures.
956950
time(time_passes,
957951
"translation",
958952
move || trans::trans_crate(tcx, &mir_map, analysis))

branches/beta/src/librustc_mir/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,3 @@ mod hair;
4242
pub mod mir_map;
4343
pub mod pretty;
4444
pub mod transform;
45-
pub mod traversal;

branches/beta/src/librustc_mir/transform/break_critical_edges.rs

Lines changed: 0 additions & 117 deletions
This file was deleted.

branches/beta/src/librustc_mir/transform/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,3 @@ pub mod simplify_cfg;
1313
pub mod erase_regions;
1414
pub mod no_landing_pads;
1515
pub mod type_check;
16-
pub mod break_critical_edges;

0 commit comments

Comments
 (0)