Skip to content

Commit 80b1cd2

Browse files
committed
---
yaml --- r: 44647 b: refs/heads/master c: bad4463 h: refs/heads/master i: 44645: 5955df0 44643: 4e0f101 44639: da710e9 v: v3
1 parent 38767a4 commit 80b1cd2

File tree

15 files changed

+21
-217
lines changed

15 files changed

+21
-217
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 8f8f0ec2c6761b096eea1f8dceb42c2618f5a196
2+
refs/heads/master: bad4463a6b793aa627afe5aeb6a4af54b9562c23
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d9689399d091c3265f00434a69c551a61c28dc
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3

trunk/src/etc/x86.supp

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -366,55 +366,6 @@
366366
...
367367
}
368368

369-
{
370-
enum-instruction-scheduling-1
371-
Memcheck:Cond
372-
fun:*fold_mod*
373-
...
374-
}
375-
376-
{
377-
enum-instruction-scheduling-2
378-
Memcheck:Cond
379-
fun:*fold_nmod*
380-
...
381-
}
382-
383-
{
384-
enum-instruction-scheduling-3
385-
Memcheck:Cond
386-
fun:*fold_crate*
387-
...
388-
}
389-
390-
{
391-
enum-instruction-scheduling-4
392-
Memcheck:Cond
393-
fun:*fold_enum*
394-
...
395-
}
396-
397-
{
398-
enum-instruction-scheduling-5
399-
Memcheck:Cond
400-
fun:*write_variant*
401-
...
402-
}
403-
404-
{
405-
enum-instruction-scheduling-6
406-
Memcheck:Cond
407-
fun:*merge_method_attrs*
408-
...
409-
}
410-
411-
{
412-
enum-instruction-scheduling-7
413-
Memcheck:Cond
414-
fun:*parse_config_*
415-
...
416-
}
417-
418369
{
419370
llvm-user-new-leak
420371
Memcheck:Leak

trunk/src/librustc/lib/llvm.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,6 @@ pub enum FileType {
184184
ObjectFile = 1
185185
}
186186

187-
pub enum Metadata {
188-
MD_dbg = 0,
189-
MD_tbaa = 1,
190-
MD_prof = 2,
191-
MD_fpmath = 3,
192-
MD_range = 4,
193-
MD_tbaa_struct = 5
194-
}
195-
196187
// Opaque pointer types
197188
pub enum Module_opaque {}
198189
pub type ModuleRef = *Module_opaque;

trunk/src/librustc/middle/trans/_match.rs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,29 +1361,13 @@ pub fn compile_submatch(bcx: block,
13611361
if opts.len() > 0u {
13621362
match opts[0] {
13631363
var(_, vdef) => {
1364-
let variants = ty::enum_variants(tcx, vdef.enm);
1365-
if variants.len() == 1 {
1364+
if (*ty::enum_variants(tcx, vdef.enm)).len() == 1u {
13661365
kind = single;
13671366
} else {
13681367
let enumptr =
13691368
PointerCast(bcx, val, T_opaque_enum_ptr(ccx));
13701369
let discrimptr = GEPi(bcx, enumptr, [0u, 0u]);
1371-
1372-
1373-
assert variants.len() > 1;
1374-
let min_discrim = do variants.foldr(0) |&x, y| {
1375-
int::min(x.disr_val, y)
1376-
};
1377-
let max_discrim = do variants.foldr(0) |&x, y| {
1378-
int::max(x.disr_val, y)
1379-
};
1380-
1381-
test_val = LoadRangeAssert(bcx, discrimptr,
1382-
min_discrim as c_ulonglong,
1383-
(max_discrim + 1)
1384-
as c_ulonglong,
1385-
lib::llvm::True);
1386-
1370+
test_val = Load(bcx, discrimptr);
13871371
kind = switch;
13881372
}
13891373
}

trunk/src/librustc/middle/trans/build.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ use lib::llvm::llvm;
1414
use lib::llvm::{CallConv, TypeKind, AtomicBinOp, AtomicOrdering};
1515
use lib::llvm::{Opcode, IntPredicate, RealPredicate, True, False};
1616
use lib::llvm::{ValueRef, TypeRef, BasicBlockRef, BuilderRef, ModuleRef};
17-
use libc::{c_uint, c_int, c_ulonglong};
17+
use libc::{c_uint, c_int};
1818
use middle::trans::common::*;
19-
use middle::trans::machine::llsize_of_real;
2019

2120
use core::cast::transmute;
2221
use core::cast;
@@ -537,25 +536,6 @@ pub fn Load(cx: block, PointerVal: ValueRef) -> ValueRef {
537536
}
538537
}
539538
540-
pub fn LoadRangeAssert(cx: block, PointerVal: ValueRef, lo: c_ulonglong,
541-
hi: c_ulonglong, signed: lib::llvm::Bool) -> ValueRef {
542-
let value = Load(cx, PointerVal);
543-
544-
unsafe {
545-
let t = llvm::LLVMGetElementType(llvm::LLVMTypeOf(PointerVal));
546-
let min = llvm::LLVMConstInt(t, lo, signed);
547-
let max = llvm::LLVMConstInt(t, hi, signed);
548-
549-
550-
do vec::as_imm_buf([min, max]) |ptr, len| {
551-
llvm::LLVMSetMetadata(value, lib::llvm::MD_range as c_uint,
552-
llvm::LLVMMDNode(ptr, len as c_uint));
553-
}
554-
}
555-
556-
value
557-
}
558-
559539
pub fn Store(cx: block, Val: ValueRef, Ptr: ValueRef) {
560540
unsafe {
561541
if cx.unreachable { return; }

trunk/src/librustc/middle/trans/datum.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,7 @@ pub impl Datum {
431431
} else {
432432
match self.mode {
433433
ByValue => self.val,
434-
ByRef => {
435-
if ty::type_is_bool(self.ty) {
436-
LoadRangeAssert(bcx, self.val, 0, 2, lib::llvm::True)
437-
} else {
438-
Load(bcx, self.val)
439-
}
440-
}
434+
ByRef => Load(bcx, self.val)
441435
}
442436
}
443437
}

trunk/src/librustc/middle/trans/expr.rs

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -491,29 +491,11 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
491491
ast::expr_swap(dst, src) => {
492492
let dst_datum = unpack_datum!(bcx, trans_lvalue(bcx, dst));
493493
let src_datum = unpack_datum!(bcx, trans_lvalue(bcx, src));
494+
let scratch = scratch_datum(bcx, dst_datum.ty, false);
494495

495-
// If the source and destination are the same, then don't swap.
496-
// Avoids performing an overlapping memcpy
497-
let dst_datum_ref = dst_datum.to_ref_llval(bcx);
498-
let src_datum_ref = src_datum.to_ref_llval(bcx);
499-
let cmp = ICmp(bcx, lib::llvm::IntEQ,
500-
src_datum_ref,
501-
dst_datum_ref);
502-
503-
let swap_cx = base::sub_block(bcx, ~"swap");
504-
let next_cx = base::sub_block(bcx, ~"next");
505-
506-
CondBr(bcx, cmp, next_cx.llbb, swap_cx.llbb);
507-
508-
let scratch = scratch_datum(swap_cx, dst_datum.ty, false);
509-
510-
let swap_cx = dst_datum.move_to_datum(swap_cx, INIT, scratch);
511-
let swap_cx = src_datum.move_to_datum(swap_cx, INIT, dst_datum);
512-
let swap_cx = scratch.move_to_datum(swap_cx, INIT, src_datum);
513-
514-
Br(swap_cx, next_cx.llbb);
515-
516-
return next_cx;
496+
let bcx = dst_datum.move_to_datum(bcx, INIT, scratch);
497+
let bcx = src_datum.move_to_datum(bcx, INIT, dst_datum);
498+
return scratch.move_to_datum(bcx, INIT, src_datum);
517499
}
518500
ast::expr_assign_op(op, dst, src) => {
519501
return trans_assign_op(bcx, expr, op, dst, src);

trunk/src/librustc/middle/ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2823,7 +2823,7 @@ pub pure fn ty_fn_ret(fty: t) -> t {
28232823
}
28242824
}
28252825

2826-
pub fn is_fn_ty(fty: t) -> bool {
2826+
fn is_fn_ty(fty: t) -> bool {
28272827
match get(fty).sty {
28282828
ty_bare_fn(_) => true,
28292829
ty_closure(_) => true,

trunk/src/librustc/middle/typeck/check/_match.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub fn check_pat_variant(pcx: pat_ctxt, pat: @ast::pat, path: @ast::path,
9292
match structure_of(pcx.fcx, pat.span, expected) {
9393
ty::ty_enum(_, ref expected_substs) => {
9494
// Lookup the enum and variant def ids:
95-
let v_def = lookup_def(pcx.fcx, pat.span, pat.id);
95+
let v_def = lookup_def(pcx.fcx, path.span, pat.id);
9696
let v_def_ids = ast_util::variant_def_ids(v_def);
9797

9898
// Assign the pattern the type of the *enum*, not the variant.
@@ -125,17 +125,8 @@ pub fn check_pat_variant(pcx: pat_ctxt, pat: @ast::pat, path: @ast::path,
125125
kind_name = "variant";
126126
}
127127
ty::ty_struct(struct_def_id, ref expected_substs) => {
128-
// Lookup the struct ctor def id
129-
let s_def = lookup_def(pcx.fcx, pat.span, pat.id);
130-
let s_def_id = ast_util::def_id_of_def(s_def);
131-
132128
// Assign the pattern the type of the struct.
133-
let ctor_tpt = ty::lookup_item_type(tcx, s_def_id);
134-
let struct_tpt = if ty::is_fn_ty(ctor_tpt.ty) {
135-
{ty: ty::ty_fn_ret(ctor_tpt.ty), ..ctor_tpt}
136-
} else {
137-
ctor_tpt
138-
};
129+
let struct_tpt = ty::lookup_item_type(tcx, struct_def_id);
139130
instantiate_path(pcx.fcx, path, struct_tpt, pat.span, pat.id,
140131
pcx.block_region);
141132

trunk/src/librustc/middle/typeck/check/method.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -438,10 +438,9 @@ pub impl LookupContext {
438438

439439
let trait_methods = ty::trait_methods(tcx, init_trait_id);
440440
let pos = {
441-
// FIXME #3453 can't use trait_methods.position
442-
match vec::position(*trait_methods,
443-
|m| (m.self_ty != ast::sty_static &&
444-
m.ident == self.m_name))
441+
match trait_methods.position(|m| {
442+
m.self_ty != ast::sty_static &&
443+
m.ident == self.m_name })
445444
{
446445
Some(pos) => pos,
447446
None => {
@@ -624,9 +623,7 @@ pub impl LookupContext {
624623
}
625624

626625
let idx = {
627-
// FIXME #3453 can't use impl_info.methods.position
628-
match vec::position(impl_info.methods,
629-
|m| m.ident == self.m_name) {
626+
match impl_info.methods.position(|m| m.ident == self.m_name) {
630627
Some(idx) => idx,
631628
None => { return; } // No method with the right name.
632629
}

trunk/src/librustc/middle/typeck/check/writeback.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,6 @@ pub fn resolve_type_vars_in_fn(fcx: @mut FnCtxt,
275275
|_bm, pat_id, span, _path| {
276276
resolve_type_vars_for_node(wbcx, span, pat_id);
277277
}
278-
// Privacy needs the type for the whole pattern, not just each binding
279-
if !pat_util::pat_is_binding(fcx.tcx().def_map, arg.pat) {
280-
resolve_type_vars_for_node(wbcx, arg.pat.span, arg.pat.id);
281-
}
282278
}
283279
return wbcx.success;
284280
}

trunk/src/librustc/middle/typeck/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ pub struct CrateCtxt {
208208
// Functions that write types into the node type table
209209
pub fn write_ty_to_tcx(tcx: ty::ctxt, node_id: ast::node_id, ty: ty::t) {
210210
debug!("write_ty_to_tcx(%d, %s)", node_id, ppaux::ty_to_str(tcx, ty));
211-
tcx.node_types.insert(node_id as uint, ty);
211+
oldsmallintmap::insert(*tcx.node_types, node_id as uint, ty);
212212
}
213213
pub fn write_substs_to_tcx(tcx: ty::ctxt,
214214
node_id: ast::node_id,

trunk/src/test/compile-fail/match-struct.rs

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

trunk/src/test/run-pass/swap-overlapping.rs

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

trunk/src/test/run-pass/issue-4875.rs renamed to trunk/src/test/run-pass/vec-position.rs

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

11-
// regression test for issue 4875
12-
13-
pub struct Foo<T> {
14-
data: T,
15-
}
16-
17-
fn foo<T>(Foo{_}: Foo<T>) {
18-
}
19-
2011
pub fn main() {
12+
let mut v = ~[1, 2, 3];
13+
assert v.position(|x| *x == 1) == Some(0);
14+
assert v.position(|x| *x == 3) == Some(2);
15+
assert v.position(|x| *x == 17) == None;
2116
}
22-

0 commit comments

Comments
 (0)