Skip to content

Commit 07fabff

Browse files
committed
---
yaml --- r: 139778 b: refs/heads/try2 c: 4bfa3c6 h: refs/heads/master v: v3
1 parent 8ccaeb3 commit 07fabff

File tree

18 files changed

+258
-337
lines changed

18 files changed

+258
-337
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: 39e2ab5e8b67763ff960203a32acc24a17beeb50
8+
refs/heads/try2: 4bfa3c6663ad6facdbdb8bd533442b050085f753
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/libc.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -863,20 +863,10 @@ pub mod consts {
863863
pub static F_TEST : int = 3;
864864
pub static F_TLOCK : int = 2;
865865
pub static F_ULOCK : int = 0;
866-
pub static SIGHUP : int = 1;
867-
pub static SIGINT : int = 2;
868-
pub static SIGQUIT : int = 3;
869-
pub static SIGILL : int = 4;
870-
pub static SIGABRT : int = 6;
871-
pub static SIGFPE : int = 8;
872866
pub static SIGKILL : int = 9;
873-
pub static SIGSEGV : int = 11;
874-
pub static SIGPIPE : int = 13;
875-
pub static SIGALRM : int = 14;
876867
pub static SIGTERM : int = 15;
877868
}
878869
pub mod posix01 {
879-
pub static SIGTRAP : int = 5;
880870
}
881871
pub mod posix08 {
882872
}
@@ -942,20 +932,10 @@ pub mod consts {
942932
pub static F_TEST : int = 3;
943933
pub static F_TLOCK : int = 2;
944934
pub static F_ULOCK : int = 0;
945-
pub static SIGHUP : int = 1;
946-
pub static SIGINT : int = 2;
947-
pub static SIGQUIT : int = 3;
948-
pub static SIGILL : int = 4;
949-
pub static SIGABRT : int = 6;
950-
pub static SIGFPE : int = 8;
951935
pub static SIGKILL : int = 9;
952-
pub static SIGSEGV : int = 11;
953-
pub static SIGPIPE : int = 13;
954-
pub static SIGALRM : int = 14;
955936
pub static SIGTERM : int = 15;
956937
}
957938
pub mod posix01 {
958-
pub static SIGTRAP : int = 5;
959939
}
960940
pub mod posix08 {
961941
}
@@ -1022,20 +1002,10 @@ pub mod consts {
10221002
pub static F_TEST : int = 3;
10231003
pub static F_TLOCK : int = 2;
10241004
pub static F_ULOCK : int = 0;
1025-
pub static SIGHUP : int = 1;
1026-
pub static SIGINT : int = 2;
1027-
pub static SIGQUIT : int = 3;
1028-
pub static SIGILL : int = 4;
1029-
pub static SIGABRT : int = 6;
1030-
pub static SIGFPE : int = 8;
10311005
pub static SIGKILL : int = 9;
1032-
pub static SIGSEGV : int = 11;
1033-
pub static SIGPIPE : int = 13;
1034-
pub static SIGALRM : int = 14;
10351006
pub static SIGTERM : int = 15;
10361007
}
10371008
pub mod posix01 {
1038-
pub static SIGTRAP : int = 5;
10391009
}
10401010
pub mod posix08 {
10411011
}

branches/try2/src/libcore/reflect.rs

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ Runtime type reflection
1515
*/
1616

1717
use intrinsic::{TyDesc, TyVisitor};
18-
#[cfg(not(stage0))] use intrinsic::Opaque;
1918
use libc::c_void;
2019
use sys;
2120
use vec;
@@ -394,7 +393,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
394393
true
395394
}
396395

397-
#[cfg(stage0)]
398396
fn visit_enter_enum(&self, n_variants: uint, sz: uint, align: uint)
399397
-> bool {
400398
self.align(align);
@@ -404,47 +402,25 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
404402
true
405403
}
406404

407-
#[cfg(not(stage0))]
408-
fn visit_enter_enum(&self, n_variants: uint,
409-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
410-
sz: uint, align: uint)
411-
-> bool {
412-
self.align(align);
413-
if ! self.inner.visit_enter_enum(n_variants, get_disr, sz, align) {
414-
return false;
415-
}
416-
true
417-
}
418-
419405
fn visit_enter_enum_variant(&self, variant: uint,
420406
disr_val: int,
421407
n_fields: uint,
422408
name: &str) -> bool {
423-
self.inner.push_ptr(); // NOTE remove after next snapshot
409+
self.inner.push_ptr();
424410
if ! self.inner.visit_enter_enum_variant(variant, disr_val,
425411
n_fields, name) {
426412
return false;
427413
}
428414
true
429415
}
430416

431-
#[cfg(stage0)]
432417
fn visit_enum_variant_field(&self, i: uint, inner: *TyDesc) -> bool {
433418
unsafe { self.align((*inner).align); }
434419
if ! self.inner.visit_enum_variant_field(i, inner) { return false; }
435420
unsafe { self.bump((*inner).size); }
436421
true
437422
}
438423

439-
#[cfg(not(stage0))]
440-
fn visit_enum_variant_field(&self, i: uint, offset: uint, inner: *TyDesc) -> bool {
441-
self.inner.push_ptr();
442-
self.bump(offset);
443-
if ! self.inner.visit_enum_variant_field(i, offset, inner) { return false; }
444-
self.inner.pop_ptr();
445-
true
446-
}
447-
448424
fn visit_leave_enum_variant(&self, variant: uint,
449425
disr_val: int,
450426
n_fields: uint,
@@ -453,11 +429,10 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
453429
n_fields, name) {
454430
return false;
455431
}
456-
self.inner.pop_ptr(); // NOTE remove after next snapshot
432+
self.inner.pop_ptr();
457433
true
458434
}
459435

460-
#[cfg(stage0)]
461436
fn visit_leave_enum(&self, n_variants: uint, sz: uint, align: uint)
462437
-> bool {
463438
if ! self.inner.visit_leave_enum(n_variants, sz, align) {
@@ -467,17 +442,6 @@ impl<V:TyVisitor + MovePtr> TyVisitor for MovePtrAdaptor<V> {
467442
true
468443
}
469444

470-
#[cfg(not(stage0))]
471-
fn visit_leave_enum(&self, n_variants: uint,
472-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
473-
sz: uint, align: uint) -> bool {
474-
if ! self.inner.visit_leave_enum(n_variants, get_disr, sz, align) {
475-
return false;
476-
}
477-
self.bump(sz);
478-
true
479-
}
480-
481445
fn visit_trait(&self) -> bool {
482446
self.align_to::<@TyVisitor>();
483447
if ! self.inner.visit_trait() { return false; }

branches/try2/src/libcore/repr.rs

Lines changed: 2 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use cast::transmute;
1818
use char;
1919
use intrinsic;
2020
use intrinsic::{TyDesc, TyVisitor, visit_tydesc};
21-
#[cfg(not(stage0))] use intrinsic::Opaque;
2221
use io::{Writer, WriterUtil};
2322
use libc::c_void;
2423
use managed;
@@ -138,20 +137,12 @@ impl Repr for char {
138137

139138
// New implementation using reflect::MovePtr
140139

141-
#[cfg(stage0)]
142140
enum VariantState {
143141
Degenerate,
144142
TagMatch,
145143
TagMismatch,
146144
}
147145

148-
#[cfg(not(stage0))]
149-
enum VariantState {
150-
SearchingFor(int),
151-
Matched,
152-
AlreadyFound
153-
}
154-
155146
pub struct ReprVisitor {
156147
mut ptr: *c_void,
157148
mut ptr_stk: ~[*c_void],
@@ -190,14 +181,14 @@ pub impl ReprVisitor {
190181
true
191182
}
192183

193-
#[cfg(stage0)] #[inline(always)]
184+
#[inline(always)]
194185
fn bump(&self, sz: uint) {
195186
do self.move_ptr() |p| {
196187
((p as uint) + sz) as *c_void
197188
};
198189
}
199190

200-
#[cfg(stage0)] #[inline(always)]
191+
#[inline(always)]
201192
fn bump_past<T>(&self) {
202193
self.bump(sys::size_of::<T>());
203194
}
@@ -467,7 +458,6 @@ impl TyVisitor for ReprVisitor {
467458
true
468459
}
469460

470-
#[cfg(stage0)]
471461
fn visit_enter_enum(&self, n_variants: uint,
472462
_sz: uint, _align: uint) -> bool {
473463
if n_variants == 1 {
@@ -478,16 +468,6 @@ impl TyVisitor for ReprVisitor {
478468
true
479469
}
480470

481-
#[cfg(not(stage0))]
482-
fn visit_enter_enum(&self, n_variants: uint,
483-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
484-
_sz: uint, _align: uint) -> bool {
485-
let disr = unsafe { get_disr(transmute(self.ptr)) };
486-
self.var_stk.push(SearchingFor(disr));
487-
true
488-
}
489-
490-
#[cfg(stage0)]
491471
fn visit_enter_enum_variant(&self, _variant: uint,
492472
disr_val: int,
493473
n_fields: uint,
@@ -520,36 +500,6 @@ impl TyVisitor for ReprVisitor {
520500
true
521501
}
522502

523-
#[cfg(not(stage0))]
524-
fn visit_enter_enum_variant(&self, _variant: uint,
525-
disr_val: int,
526-
n_fields: uint,
527-
name: &str) -> bool {
528-
let mut write = false;
529-
match self.var_stk.pop() {
530-
SearchingFor(sought) => {
531-
if disr_val == sought {
532-
self.var_stk.push(Matched);
533-
write = true;
534-
} else {
535-
self.var_stk.push(SearchingFor(sought));
536-
}
537-
}
538-
Matched | AlreadyFound => {
539-
self.var_stk.push(AlreadyFound);
540-
}
541-
}
542-
543-
if write {
544-
self.writer.write_str(name);
545-
if n_fields > 0 {
546-
self.writer.write_char('(');
547-
}
548-
}
549-
true
550-
}
551-
552-
#[cfg(stage0)]
553503
fn visit_enum_variant_field(&self, i: uint, inner: *TyDesc) -> bool {
554504
match self.var_stk[vec::uniq_len(&const self.var_stk) - 1] {
555505
Degenerate | TagMatch => {
@@ -565,23 +515,6 @@ impl TyVisitor for ReprVisitor {
565515
true
566516
}
567517

568-
#[cfg(not(stage0))]
569-
fn visit_enum_variant_field(&self, i: uint, _offset: uint, inner: *TyDesc) -> bool {
570-
match self.var_stk[vec::uniq_len(&const self.var_stk) - 1] {
571-
Matched => {
572-
if i != 0 {
573-
self.writer.write_str(", ");
574-
}
575-
if ! self.visit_inner(inner) {
576-
return false;
577-
}
578-
}
579-
_ => ()
580-
}
581-
true
582-
}
583-
584-
#[cfg(stage0)]
585518
fn visit_leave_enum_variant(&self, _variant: uint,
586519
_disr_val: int,
587520
n_fields: uint,
@@ -597,39 +530,12 @@ impl TyVisitor for ReprVisitor {
597530
true
598531
}
599532

600-
#[cfg(not(stage0))]
601-
fn visit_leave_enum_variant(&self, _variant: uint,
602-
_disr_val: int,
603-
n_fields: uint,
604-
_name: &str) -> bool {
605-
match self.var_stk[vec::uniq_len(&const self.var_stk) - 1] {
606-
Matched => {
607-
if n_fields > 0 {
608-
self.writer.write_char(')');
609-
}
610-
}
611-
_ => ()
612-
}
613-
true
614-
}
615-
616-
#[cfg(stage0)]
617533
fn visit_leave_enum(&self, _n_variants: uint,
618534
_sz: uint, _align: uint) -> bool {
619535
self.var_stk.pop();
620536
true
621537
}
622538

623-
#[cfg(not(stage0))]
624-
fn visit_leave_enum(&self, _n_variants: uint,
625-
_get_disr: extern unsafe fn(ptr: *Opaque) -> int,
626-
_sz: uint, _align: uint) -> bool {
627-
match self.var_stk.pop() {
628-
SearchingFor(*) => fail!(~"enum value matched no variant"),
629-
_ => true
630-
}
631-
}
632-
633539
fn visit_enter_fn(&self, _purity: uint, _proto: uint,
634540
_n_inputs: uint, _retstyle: uint) -> bool { true }
635541
fn visit_fn_input(&self, _i: uint, _mode: uint, _inner: *TyDesc) -> bool {

branches/try2/src/librustc/front/intrinsic.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ pub mod intrinsic {
2828
// Remaining fields not listed
2929
}
3030

31-
pub enum Opaque { }
32-
3331
pub trait TyVisitor {
3432
fn visit_bot(&self) -> bool;
3533
fn visit_nil(&self) -> bool;
@@ -93,19 +91,17 @@ pub mod intrinsic {
9391
sz: uint, align: uint) -> bool;
9492

9593
fn visit_enter_enum(&self, n_variants: uint,
96-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
9794
sz: uint, align: uint) -> bool;
9895
fn visit_enter_enum_variant(&self, variant: uint,
9996
disr_val: int,
10097
n_fields: uint,
10198
name: &str) -> bool;
102-
fn visit_enum_variant_field(&self, i: uint, offset: uint, inner: *TyDesc) -> bool;
99+
fn visit_enum_variant_field(&self, i: uint, inner: *TyDesc) -> bool;
103100
fn visit_leave_enum_variant(&self, variant: uint,
104101
disr_val: int,
105102
n_fields: uint,
106103
name: &str) -> bool;
107104
fn visit_leave_enum(&self, n_variants: uint,
108-
get_disr: extern unsafe fn(ptr: *Opaque) -> int,
109105
sz: uint, align: uint) -> bool;
110106

111107
fn visit_enter_fn(&self, purity: uint, proto: uint,

0 commit comments

Comments
 (0)