Skip to content

Commit 3c17c0c

Browse files
committed
---
yaml --- r: 144146 b: refs/heads/try2 c: dc9b3e3 h: refs/heads/master v: v3
1 parent 35e517d commit 3c17c0c

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

+1189
-2072
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: a8c3fe45c6138cd1f4d143fdb0e843ee2d4759b2
8+
refs/heads/try2: dc9b3e37e2aea4e74489e17f94d591c755ca97dd
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)) $$(JEMALLOC_LIB_$(1)_$(2))
150+
$$(RUNTIME_DEF_$(1)_$(2)) $$(LIBUV_LIB_$(1)_$(2))
151151
@$$(call E, link: $$@)
152152
$$(Q)$$(call CFG_LINK_CXX_$(1),$$@, $$(RUNTIME_OBJS_$(1)_$(2)) \
153-
$$(JEMALLOC_LIB_$(1)_$(2)) $$(CFG_GCCISH_POST_LIB_FLAGS_$(1)) $$(LIBUV_LIB_$(1)_$(2)) \
153+
$$(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: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ 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;
3029

3130
use extra::test::MetricMap;
3231

@@ -39,21 +38,11 @@ pub fn run(config: config, testfile: ~str) {
3938
// that destroys parallelism if we let normal schedulers block.
4039
// It should be possible to remove this spawn once std::run is
4140
// rewritten to be non-blocking.
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() {
41+
do spawn_sched(SingleThreaded) {
4642
let config = config.take();
4743
let testfile = testfile.take();
4844
let mut _mm = MetricMap::new();
4945
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-
}
5746
}
5847
}
5948

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ 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"),
296297
("simplifycfg", "Simplify the CFG"),
297298
("sink", "Code sinking"),
298299
("strip", "Strip all symbols from a module"),

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

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ 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,
9297
}
9398

9499
// enum for the LLVM IntPredicate type
@@ -842,9 +847,7 @@ pub mod llvm {
842847
#[fast_ffi]
843848
pub fn LLVMSetGC(Fn: ValueRef, Name: *c_char);
844849
#[fast_ffi]
845-
pub fn LLVMAddFunctionAttr(Fn: ValueRef, PA: c_uint);
846-
#[fast_ffi]
847-
pub fn LLVMAddFunctionAttrString(Fn: ValueRef, Name: *c_char);
850+
pub fn LLVMAddFunctionAttr(Fn: ValueRef, PA: c_uint, HighPA: c_uint);
848851
#[fast_ffi]
849852
pub fn LLVMGetFunctionAttr(Fn: ValueRef) -> c_ulonglong;
850853
#[fast_ffi]
@@ -2135,7 +2138,23 @@ pub fn ConstFCmp(Pred: RealPredicate, V1: ValueRef, V2: ValueRef) -> ValueRef {
21352138

21362139
pub fn SetFunctionAttribute(Fn: ValueRef, attr: Attribute) {
21372140
unsafe {
2138-
llvm::LLVMAddFunctionAttr(Fn, attr as c_uint)
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);
21392158
}
21402159
}
21412160
/* Memory-managed object interface to type handles. */

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

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ 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::visit;
31-
use syntax::visit::Visitor;
30+
use syntax::oldvisit;
3231
use util::ppaux::Repr;
3332

3433
#[deriving(Clone)]
@@ -40,27 +39,6 @@ struct CheckLoanCtxt<'self> {
4039
reported: @mut HashSet<ast::NodeId>,
4140
}
4241

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-
6442
pub fn check_loans(bccx: @BorrowckCtxt,
6543
dfcx_loans: &LoanDataFlow,
6644
move_data: move_data::FlowedMoveData,
@@ -76,8 +54,15 @@ pub fn check_loans(bccx: @BorrowckCtxt,
7654
reported: @mut HashSet::new(),
7755
};
7856

79-
let mut vt = CheckLoanVisitor;
80-
vt.visit_block(body, clcx);
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));
8166
}
8267

8368
enum MoveError {
@@ -641,27 +626,27 @@ impl<'self> CheckLoanCtxt<'self> {
641626
}
642627
}
643628

644-
fn check_loans_in_fn<'a>(visitor: &mut CheckLoanVisitor,
645-
fk: &visit::fn_kind,
629+
fn check_loans_in_fn<'a>(fk: &oldvisit::fn_kind,
646630
decl: &ast::fn_decl,
647631
body: &ast::Block,
648632
sp: span,
649633
id: ast::NodeId,
650-
this: CheckLoanCtxt<'a>) {
634+
(this, visitor): (CheckLoanCtxt<'a>,
635+
oldvisit::vt<CheckLoanCtxt<'a>>)) {
651636
match *fk {
652-
visit::fk_item_fn(*) |
653-
visit::fk_method(*) => {
637+
oldvisit::fk_item_fn(*) |
638+
oldvisit::fk_method(*) => {
654639
// Don't process nested items.
655640
return;
656641
}
657642

658-
visit::fk_anon(*) |
659-
visit::fk_fn_block(*) => {
643+
oldvisit::fk_anon(*) |
644+
oldvisit::fk_fn_block(*) => {
660645
check_captured_variables(this, id, sp);
661646
}
662647
}
663648

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

666651
fn check_captured_variables(this: CheckLoanCtxt,
667652
closure_id: ast::NodeId,
@@ -704,16 +689,16 @@ fn check_loans_in_fn<'a>(visitor: &mut CheckLoanVisitor,
704689
}
705690
}
706691

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);
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));
711696
}
712697

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);
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));
717702

718703
debug!("check_loans_in_expr(expr=%s)",
719704
expr.repr(this.tcx()));
@@ -764,19 +749,19 @@ fn check_loans_in_expr<'a>(vt: &mut CheckLoanVisitor,
764749
}
765750
}
766751

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

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

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

Lines changed: 9 additions & 14 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};
1820
use syntax::parse::token::special_idents;
19-
use syntax::visit;
20-
use syntax::visit::Visitor;
2121
use std::util;
2222

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

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-
}
42+
type EntryVisitor = vt<@mut EntryContext>;
4943

5044
pub fn find_entry_point(session: Session, crate: &Crate, ast_map: ast_map::map) {
5145

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

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

7873
configure_main(ctxt);
7974
}
8075

81-
fn find_item(item: @item, ctxt: @mut EntryContext, visitor: &mut EntryVisitor) {
76+
fn find_item(item: @item, ctxt: @mut EntryContext, visitor: EntryVisitor) {
8277
match item.node {
8378
item_fn(*) => {
8479
if item.ident == special_idents::main {
@@ -125,7 +120,7 @@ fn find_item(item: @item, ctxt: @mut EntryContext, visitor: &mut EntryVisitor) {
125120
_ => ()
126121
}
127122

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

131126
fn configure_main(ctxt: @mut EntryContext) {

0 commit comments

Comments
 (0)