Skip to content

Commit 0a2919e

Browse files
committed
---
yaml --- r: 144150 b: refs/heads/try2 c: 3cd978f h: refs/heads/master v: v3
1 parent 08ddab5 commit 0a2919e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1850
-1041
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: ef5d537010dbc7192b15e44ac01c62af45de4df9
8+
refs/heads/try2: 3cd978fbc75a691a144dcafe99a08531a424fcd0
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/rt.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ rt/$(1)/stage$(2)/arch/$$(HOST_$(1))/libmorestack.a: $$(MORESTACK_OBJ_$(1)_$(2))
147147
$$(Q)$(AR_$(1)) rcs $$@ $$<
148148

149149
rt/$(1)/stage$(2)/$(CFG_RUNTIME_$(1)): $$(RUNTIME_OBJS_$(1)_$(2)) $$(MKFILE_DEPS) \
150-
$$(RUNTIME_DEF_$(1)_$(2)) $$(LIBUV_LIB_$(1)_$(2))
150+
$$(RUNTIME_DEF_$(1)_$(2)) $$(LIBUV_LIB_$(1)_$(2)) $$(JEMALLOC_LIB_$(1)_$(2))
151151
@$$(call E, link: $$@)
152152
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@, $$(RUNTIME_OBJS_$(1)_$(2)) \
153-
$$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(LIBUV_LIB_$(1)_$(2)) \
153+
$$(JEMALLOC_LIB_$(1)_$(2)) $$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(LIBUV_LIB_$(1)_$(2)) \
154154
$$(CFG_LIBUV_LINK_FLAGS_$(1)),$$(RUNTIME_DEF_$(1)_$(2)),$$(CFG_RUNTIME_$(1)))
155155

156156
# FIXME: For some reason libuv's makefiles can't figure out the

branches/try2/src/compiletest/runtest.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ use std::os;
2626
use std::str;
2727
use std::task::{spawn_sched, SingleThreaded};
2828
use std::vec;
29+
use std::unstable::running_on_valgrind;
2930

3031
use extra::test::MetricMap;
3132

@@ -38,11 +39,21 @@ pub fn run(config: config, testfile: ~str) {
3839
// that destroys parallelism if we let normal schedulers block.
3940
// It should be possible to remove this spawn once std::run is
4041
// rewritten to be non-blocking.
41-
do spawn_sched(SingleThreaded) {
42+
//
43+
// We do _not_ create another thread if we're running on V because
44+
// it serializes all threads anyways.
45+
if running_on_valgrind() {
4246
let config = config.take();
4347
let testfile = testfile.take();
4448
let mut _mm = MetricMap::new();
4549
run_metrics(config, testfile, &mut _mm);
50+
} else {
51+
do spawn_sched(SingleThreaded) {
52+
let config = config.take();
53+
let testfile = testfile.take();
54+
let mut _mm = MetricMap::new();
55+
run_metrics(config, testfile, &mut _mm);
56+
}
4657
}
4758
}
4859

branches/try2/src/librustc/back/passes.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ pub static transform_passes : &'static [(&'static str, &'static str)] = &'static
293293
("scalarrepl", "Scalar Replacement of Aggregates (DT)"),
294294
("scalarrepl-ssa", "Scalar Replacement of Aggregates (SSAUp)"),
295295
("sccp", "Sparse Conditional Constant Propagation"),
296-
("simplify-libcalls", "Simplify well-known library calls"),
297296
("simplifycfg", "Simplify the CFG"),
298297
("sink", "Code sinking"),
299298
("strip", "Strip all symbols from a module"),

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ pub enum Attribute {
8989
ReturnsTwiceAttribute = 1 << 29,
9090
UWTableAttribute = 1 << 30,
9191
NonLazyBindAttribute = 1 << 31,
92-
93-
// Not added to LLVM yet, so may need to stay updated if LLVM changes.
94-
// FIXME(#8199): if this changes, be sure to change the relevant constant
95-
// down below
96-
// FixedStackSegment = 1 << 41,
9792
}
9893

9994
// enum for the LLVM IntPredicate type
@@ -847,7 +842,9 @@ pub mod llvm {
847842
#[fast_ffi]
848843
pub fn LLVMSetGC(Fn: ValueRef, Name: *c_char);
849844
#[fast_ffi]
850-
pub fn LLVMAddFunctionAttr(Fn: ValueRef, PA: c_uint, HighPA: c_uint);
845+
pub fn LLVMAddFunctionAttr(Fn: ValueRef, PA: c_uint);
846+
#[fast_ffi]
847+
pub fn LLVMAddFunctionAttrString(Fn: ValueRef, Name: *c_char);
851848
#[fast_ffi]
852849
pub fn LLVMGetFunctionAttr(Fn: ValueRef) -> c_ulonglong;
853850
#[fast_ffi]
@@ -2138,23 +2135,7 @@ pub fn ConstFCmp(Pred: RealPredicate, V1: ValueRef, V2: ValueRef) -> ValueRef {
21382135

21392136
pub fn SetFunctionAttribute(Fn: ValueRef, attr: Attribute) {
21402137
unsafe {
2141-
let attr = attr as u64;
2142-
let lower = attr & 0xffffffff;
2143-
let upper = (attr >> 32) & 0xffffffff;
2144-
llvm::LLVMAddFunctionAttr(Fn, lower as c_uint, upper as c_uint);
2145-
}
2146-
}
2147-
2148-
// FIXME(#8199): this shouldn't require this hackery. On i686
2149-
// (FixedStackSegment as u64) will return 0 instead of 1 << 41.
2150-
// Furthermore, if we use a match of any sort then an LLVM
2151-
// assertion is generated!
2152-
pub fn SetFixedStackSegmentAttribute(Fn: ValueRef) {
2153-
unsafe {
2154-
let attr = 1u64 << 41;
2155-
let lower = attr & 0xffffffff;
2156-
let upper = (attr >> 32) & 0xffffffff;
2157-
llvm::LLVMAddFunctionAttr(Fn, lower as c_uint, upper as c_uint);
2138+
llvm::LLVMAddFunctionAttr(Fn, attr as c_uint)
21582139
}
21592140
}
21602141
/* Memory-managed object interface to type handles. */

branches/try2/src/librustc/middle/astencode.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,13 @@ impl tr for method_origin {
586586
}
587587
)
588588
}
589-
typeck::method_trait(did, m) => {
590-
typeck::method_trait(did.tr(xcx), m)
589+
typeck::method_object(ref mo) => {
590+
typeck::method_object(
591+
typeck::method_object {
592+
trait_id: mo.trait_id.tr(xcx),
593+
.. *mo
594+
}
595+
)
591596
}
592597
}
593598
}

branches/try2/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 49 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ use syntax::ast::{m_mutbl, m_imm, m_const};
2727
use syntax::ast;
2828
use syntax::ast_util;
2929
use syntax::codemap::span;
30-
use syntax::oldvisit;
30+
use syntax::visit;
31+
use syntax::visit::Visitor;
3132
use util::ppaux::Repr;
3233

3334
#[deriving(Clone)]
@@ -39,6 +40,27 @@ struct CheckLoanCtxt<'self> {
3940
reported: @mut HashSet<ast::NodeId>,
4041
}
4142

43+
struct CheckLoanVisitor;
44+
45+
impl<'self> Visitor<CheckLoanCtxt<'self>> for CheckLoanVisitor {
46+
fn visit_expr<'a>(&mut self, ex:@ast::expr, e:CheckLoanCtxt<'a>) {
47+
check_loans_in_expr(self, ex, e);
48+
}
49+
fn visit_local(&mut self, l:@ast::Local, e:CheckLoanCtxt) {
50+
check_loans_in_local(self, l, e);
51+
}
52+
fn visit_block(&mut self, b:&ast::Block, e:CheckLoanCtxt) {
53+
check_loans_in_block(self, b, e);
54+
}
55+
fn visit_pat(&mut self, p:@ast::pat, e:CheckLoanCtxt) {
56+
check_loans_in_pat(self, p, e);
57+
}
58+
fn visit_fn(&mut self, fk:&visit::fn_kind, fd:&ast::fn_decl,
59+
b:&ast::Block, s:span, n:ast::NodeId, e:CheckLoanCtxt) {
60+
check_loans_in_fn(self, fk, fd, b, s, n, e);
61+
}
62+
}
63+
4264
pub fn check_loans(bccx: @BorrowckCtxt,
4365
dfcx_loans: &LoanDataFlow,
4466
move_data: move_data::FlowedMoveData,
@@ -54,15 +76,8 @@ pub fn check_loans(bccx: @BorrowckCtxt,
5476
reported: @mut HashSet::new(),
5577
};
5678

57-
let vt = oldvisit::mk_vt(@oldvisit::Visitor {
58-
visit_expr: check_loans_in_expr,
59-
visit_local: check_loans_in_local,
60-
visit_block: check_loans_in_block,
61-
visit_pat: check_loans_in_pat,
62-
visit_fn: check_loans_in_fn,
63-
.. *oldvisit::default_visitor()
64-
});
65-
(vt.visit_block)(body, (clcx, vt));
79+
let mut vt = CheckLoanVisitor;
80+
vt.visit_block(body, clcx);
6681
}
6782

6883
enum MoveError {
@@ -626,27 +641,27 @@ impl<'self> CheckLoanCtxt<'self> {
626641
}
627642
}
628643

629-
fn check_loans_in_fn<'a>(fk: &oldvisit::fn_kind,
644+
fn check_loans_in_fn<'a>(visitor: &mut CheckLoanVisitor,
645+
fk: &visit::fn_kind,
630646
decl: &ast::fn_decl,
631647
body: &ast::Block,
632648
sp: span,
633649
id: ast::NodeId,
634-
(this, visitor): (CheckLoanCtxt<'a>,
635-
oldvisit::vt<CheckLoanCtxt<'a>>)) {
650+
this: CheckLoanCtxt<'a>) {
636651
match *fk {
637-
oldvisit::fk_item_fn(*) |
638-
oldvisit::fk_method(*) => {
652+
visit::fk_item_fn(*) |
653+
visit::fk_method(*) => {
639654
// Don't process nested items.
640655
return;
641656
}
642657

643-
oldvisit::fk_anon(*) |
644-
oldvisit::fk_fn_block(*) => {
658+
visit::fk_anon(*) |
659+
visit::fk_fn_block(*) => {
645660
check_captured_variables(this, id, sp);
646661
}
647662
}
648663

649-
oldvisit::visit_fn(fk, decl, body, sp, id, (this, visitor));
664+
visit::walk_fn(visitor, fk, decl, body, sp, id, this);
650665

651666
fn check_captured_variables(this: CheckLoanCtxt,
652667
closure_id: ast::NodeId,
@@ -689,16 +704,16 @@ fn check_loans_in_fn<'a>(fk: &oldvisit::fn_kind,
689704
}
690705
}
691706

692-
fn check_loans_in_local<'a>(local: @ast::Local,
693-
(this, vt): (CheckLoanCtxt<'a>,
694-
oldvisit::vt<CheckLoanCtxt<'a>>)) {
695-
oldvisit::visit_local(local, (this, vt));
707+
fn check_loans_in_local<'a>(vt: &mut CheckLoanVisitor,
708+
local: @ast::Local,
709+
this: CheckLoanCtxt<'a>) {
710+
visit::walk_local(vt, local, this);
696711
}
697712

698-
fn check_loans_in_expr<'a>(expr: @ast::expr,
699-
(this, vt): (CheckLoanCtxt<'a>,
700-
oldvisit::vt<CheckLoanCtxt<'a>>)) {
701-
oldvisit::visit_expr(expr, (this, vt));
713+
fn check_loans_in_expr<'a>(vt: &mut CheckLoanVisitor,
714+
expr: @ast::expr,
715+
this: CheckLoanCtxt<'a>) {
716+
visit::walk_expr(vt, expr, this);
702717

703718
debug!("check_loans_in_expr(expr=%s)",
704719
expr.repr(this.tcx()));
@@ -749,19 +764,19 @@ fn check_loans_in_expr<'a>(expr: @ast::expr,
749764
}
750765
}
751766

752-
fn check_loans_in_pat<'a>(pat: @ast::pat,
753-
(this, vt): (CheckLoanCtxt<'a>,
754-
oldvisit::vt<CheckLoanCtxt<'a>>))
767+
fn check_loans_in_pat<'a>(vt: &mut CheckLoanVisitor,
768+
pat: @ast::pat,
769+
this: CheckLoanCtxt<'a>)
755770
{
756771
this.check_for_conflicting_loans(pat.id);
757772
this.check_move_out_from_id(pat.id, pat.span);
758-
oldvisit::visit_pat(pat, (this, vt));
773+
visit::walk_pat(vt, pat, this);
759774
}
760775

761-
fn check_loans_in_block<'a>(blk: &ast::Block,
762-
(this, vt): (CheckLoanCtxt<'a>,
763-
oldvisit::vt<CheckLoanCtxt<'a>>))
776+
fn check_loans_in_block<'a>(vt: &mut CheckLoanVisitor,
777+
blk: &ast::Block,
778+
this: CheckLoanCtxt<'a>)
764779
{
765-
oldvisit::visit_block(blk, (this, vt));
780+
visit::walk_block(vt, blk, this);
766781
this.check_for_conflicting_loans(blk.id);
767782
}

branches/try2/src/librustc/middle/entry.rs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ use syntax::ast::{Crate, NodeId, item, item_fn};
1515
use syntax::ast_map;
1616
use syntax::attr;
1717
use syntax::codemap::span;
18-
use syntax::oldvisit::{default_visitor, mk_vt, vt, Visitor, visit_crate};
19-
use syntax::oldvisit::{visit_item};
2018
use syntax::parse::token::special_idents;
19+
use syntax::visit;
20+
use syntax::visit::Visitor;
2121
use std::util;
2222

2323
struct EntryContext {
@@ -39,7 +39,13 @@ struct EntryContext {
3939
non_main_fns: ~[(NodeId, span)],
4040
}
4141

42-
type EntryVisitor = vt<@mut EntryContext>;
42+
struct EntryVisitor;
43+
44+
impl Visitor<@mut EntryContext> for EntryVisitor {
45+
fn visit_item(&mut self, item:@item, ctxt:@mut EntryContext) {
46+
find_item(item, ctxt, self);
47+
}
48+
}
4349

4450
pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map) {
4551

@@ -65,15 +71,14 @@ pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map)
6571
non_main_fns: ~[],
6672
};
6773

68-
visit_crate(crate, (ctxt, mk_vt(@Visitor {
69-
visit_item: |item, (ctxt, visitor)| find_item(item, ctxt, visitor),
70-
.. *default_visitor()
71-
})));
74+
let mut v = EntryVisitor;
75+
76+
visit::walk_crate(&mut v, crate, ctxt);
7277

7378
configure_main(ctxt);
7479
}
7580

76-
fn find_item(item: @item, ctxt: @mut EntryContext, visitor: EntryVisitor) {
81+
fn find_item(item: @item, ctxt: @mut EntryContext, visitor: &mut EntryVisitor) {
7782
match item.node {
7883
item_fn(*) => {
7984
if item.ident == special_idents::main {
@@ -120,7 +125,7 @@ fn find_item(item: @item, ctxt: @mut EntryContext, visitor: EntryVisitor) {
120125
_ => ()
121126
}
122127

123-
visit_item(item, (ctxt, visitor));
128+
visit::walk_item(visitor, item, ctxt);
124129
}
125130

126131
fn configure_main(ctxt: @mut EntryContext) {

0 commit comments

Comments
 (0)