Skip to content

Commit 5e87c81

Browse files
committed
---
yaml --- r: 146066 b: refs/heads/try2 c: 4533432 h: refs/heads/master v: v3
1 parent a2f9f75 commit 5e87c81

File tree

10 files changed

+95
-86
lines changed

10 files changed

+95
-86
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: 6e6981c3eb92ab87342ae9ccb3ead879fb7cbdb0
8+
refs/heads/try2: 45334326127285e9442ae1c3e9f4ba9c428ec3c6
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
3434
("macro_rules", Active),
3535
("struct_variant", Active),
3636
("once_fns", Active),
37-
("asm", Active),
3837

3938
// These are used to test this portion of the compiler, they don't actually
4039
// mean anything
@@ -109,29 +108,26 @@ impl Visitor<()> for Context {
109108
}
110109
}
111110

111+
ast::item_mac(ref mac) => {
112+
match mac.node {
113+
ast::mac_invoc_tt(ref path, _, _) => {
114+
let rules = self.sess.ident_of("macro_rules");
115+
if path.segments.last().identifier == rules {
116+
self.gate_feature("macro_rules", i.span,
117+
"macro definitions are not \
118+
stable enough for use and are \
119+
subject to change");
120+
}
121+
}
122+
}
123+
}
124+
112125
_ => {}
113126
}
114127

115128
visit::walk_item(self, i, ());
116129
}
117130

118-
fn visit_mac(&mut self, macro: &ast::mac, _: ()) {
119-
let ast::mac_invoc_tt(ref path, _, _) = macro.node;
120-
121-
if path.segments.last().identifier == self.sess.ident_of("macro_rules") {
122-
self.gate_feature("macro_rules", path.span, "macro definitions are \
123-
not stable enough for use and are subject to change");
124-
}
125-
126-
else if path.segments.last().identifier == self.sess.ident_of("asm") {
127-
// NOTE: remove the false once the ASM feature is in the next snapshot
128-
if false {
129-
self.gate_feature("asm", path.span, "inline assembly is not \
130-
stable enough for use and is subject to change");
131-
}
132-
}
133-
}
134-
135131
fn visit_ty(&mut self, t: &ast::Ty, _: ()) {
136132
match t.node {
137133
ast::ty_closure(closure) if closure.onceness == ast::Once => {

branches/try2/src/librustc/middle/trans/base.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,13 +2797,23 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
27972797

27982798
ifn!(intrinsics, "llvm.fabs.f32", [Type::f32()], Type::f32());
27992799
ifn!(intrinsics, "llvm.fabs.f64", [Type::f64()], Type::f64());
2800+
ifn!(intrinsics, "llvm.copysign.f32", [Type::f32()], Type::f32());
2801+
ifn!(intrinsics, "llvm.copysign.f64", [Type::f64()], Type::f64());
2802+
28002803
ifn!(intrinsics, "llvm.floor.f32",[Type::f32()], Type::f32());
28012804
ifn!(intrinsics, "llvm.floor.f64",[Type::f64()], Type::f64());
28022805
ifn!(intrinsics, "llvm.ceil.f32", [Type::f32()], Type::f32());
28032806
ifn!(intrinsics, "llvm.ceil.f64", [Type::f64()], Type::f64());
28042807
ifn!(intrinsics, "llvm.trunc.f32",[Type::f32()], Type::f32());
28052808
ifn!(intrinsics, "llvm.trunc.f64",[Type::f64()], Type::f64());
28062809

2810+
ifn!(intrinsics, "llvm.rint.f32",[Type::f64()], Type::f64());
2811+
ifn!(intrinsics, "llvm.rint.f64",[Type::f64()], Type::f64());
2812+
ifn!(intrinsics, "llvm.nearbyint.f32",[Type::f64()], Type::f64());
2813+
ifn!(intrinsics, "llvm.nearbyint.f64",[Type::f64()], Type::f64());
2814+
ifn!(intrinsics, "llvm.round.f32",[Type::f64()], Type::f64());
2815+
ifn!(intrinsics, "llvm.round.f64",[Type::f64()], Type::f64());
2816+
28072817
ifn!(intrinsics, "llvm.ctpop.i8", [Type::i8()], Type::i8());
28082818
ifn!(intrinsics, "llvm.ctpop.i16",[Type::i16()], Type::i16());
28092819
ifn!(intrinsics, "llvm.ctpop.i32",[Type::i32()], Type::i32());

branches/try2/src/librustc/middle/trans/intrinsic.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,20 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
460460
"fmaf64" => simple_llvm_intrinsic(bcx, "llvm.fma.f64", 3),
461461
"fabsf32" => simple_llvm_intrinsic(bcx, "llvm.fabs.f32", 1),
462462
"fabsf64" => simple_llvm_intrinsic(bcx, "llvm.fabs.f64", 1),
463+
"copysignf32" => simple_llvm_intrinsic(bcx, "llvm.copysign.f32", 1),
464+
"copysignf64" => simple_llvm_intrinsic(bcx, "llvm.copysign.f64", 1),
463465
"floorf32" => simple_llvm_intrinsic(bcx, "llvm.floor.f32", 1),
464466
"floorf64" => simple_llvm_intrinsic(bcx, "llvm.floor.f64", 1),
465467
"ceilf32" => simple_llvm_intrinsic(bcx, "llvm.ceil.f32", 1),
466468
"ceilf64" => simple_llvm_intrinsic(bcx, "llvm.ceil.f64", 1),
467469
"truncf32" => simple_llvm_intrinsic(bcx, "llvm.trunc.f32", 1),
468470
"truncf64" => simple_llvm_intrinsic(bcx, "llvm.trunc.f64", 1),
471+
"rintf64" => simple_llvm_intrinsic(bcx, "llvm.rint.f64", 1),
472+
"rintf32" => simple_llvm_intrinsic(bcx, "llvm.rint.f32", 1),
473+
"nearbyintf32" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f64", 1),
474+
"nearbyintf64" => simple_llvm_intrinsic(bcx, "llvm.nearbyint.f32", 1),
475+
"roundf32" => simple_llvm_intrinsic(bcx, "llvm.round.f64", 1),
476+
"roundf64" => simple_llvm_intrinsic(bcx, "llvm.round.f32", 1),
469477
"ctpop8" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i8", 1),
470478
"ctpop16" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i16", 1),
471479
"ctpop32" => simple_llvm_intrinsic(bcx, "llvm.ctpop.i32", 1),

branches/try2/src/librustc/middle/typeck/check/mod.rs

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,29 +3807,37 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
38073807
~[ ty::mk_f64(), ty::mk_f64(), ty::mk_f64() ],
38083808
ty::mk_f64())
38093809
}
3810-
"fabsf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3811-
"fabsf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3812-
"floorf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3813-
"floorf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3814-
"ceilf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3815-
"ceilf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3816-
"truncf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3817-
"truncf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3818-
"ctpop8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3819-
"ctpop16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3820-
"ctpop32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3821-
"ctpop64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3822-
"ctlz8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3823-
"ctlz16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3824-
"ctlz32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3825-
"ctlz64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3826-
"cttz8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3827-
"cttz16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3828-
"cttz32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3829-
"cttz64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3830-
"bswap16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3831-
"bswap32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3832-
"bswap64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3810+
"fabsf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3811+
"fabsf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3812+
"copysignf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3813+
"copysignf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3814+
"floorf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3815+
"floorf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3816+
"ceilf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3817+
"ceilf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3818+
"truncf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3819+
"truncf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3820+
"rintf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3821+
"rintf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3822+
"nearbyintf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3823+
"nearbyintf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3824+
"roundf32" => (0, ~[ ty::mk_f32() ], ty::mk_f32()),
3825+
"roundf64" => (0, ~[ ty::mk_f64() ], ty::mk_f64()),
3826+
"ctpop8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3827+
"ctpop16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3828+
"ctpop32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3829+
"ctpop64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3830+
"ctlz8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3831+
"ctlz16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3832+
"ctlz32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3833+
"ctlz64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3834+
"cttz8" => (0, ~[ ty::mk_i8() ], ty::mk_i8()),
3835+
"cttz16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3836+
"cttz32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3837+
"cttz64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
3838+
"bswap16" => (0, ~[ ty::mk_i16() ], ty::mk_i16()),
3839+
"bswap32" => (0, ~[ ty::mk_i32() ], ty::mk_i32()),
3840+
"bswap64" => (0, ~[ ty::mk_i64() ], ty::mk_i64()),
38333841

38343842
"i8_add_with_overflow" | "i8_sub_with_overflow" | "i8_mul_with_overflow" =>
38353843
(0, ~[ty::mk_i8(), ty::mk_i8()],

branches/try2/src/libstd/rt/io/stdio.rs

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

11-
use fmt;
1211
use libc;
1312
use option::{Option, Some, None};
1413
use result::{Ok, Err};
@@ -57,9 +56,7 @@ pub fn stderr() -> StdWriter {
5756
pub fn print(s: &str) {
5857
// XXX: need to see if not caching stdin() is the cause of performance
5958
// issues, it should be possible to cache a stdout handle in each Task
60-
// and then re-use that across calls to print/println. Note that the
61-
// resolution of this comment will affect all of the prints below as
62-
// well.
59+
// and then re-use that across calls to print/println
6360
stdout().write(s.as_bytes());
6461
}
6562

@@ -71,20 +68,6 @@ pub fn println(s: &str) {
7168
out.write(['\n' as u8]);
7269
}
7370

74-
/// Similar to `print`, but takes a `fmt::Arguments` structure to be compatible
75-
/// with the `format_args!` macro.
76-
pub fn print_args(fmt: &fmt::Arguments) {
77-
let mut out = stdout();
78-
fmt::write(&mut out as &mut Writer, fmt);
79-
}
80-
81-
/// Similar to `println`, but takes a `fmt::Arguments` structure to be
82-
/// compatible with the `format_args!` macro.
83-
pub fn println_args(fmt: &fmt::Arguments) {
84-
let mut out = stdout();
85-
fmt::writeln(&mut out as &mut Writer, fmt);
86-
}
87-
8871
/// Representation of a reader of a standard input stream
8972
pub struct StdReader {
9073
priv inner: ~RtioFileStream

branches/try2/src/libstd/unstable/intrinsics.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,11 @@ extern "rust-intrinsic" {
413413
pub fn fabsf32(x: f32) -> f32;
414414
pub fn fabsf64(x: f64) -> f64;
415415

416+
#[cfg(not(stage0))]
417+
pub fn copysignf32(x: f32) -> f32;
418+
#[cfg(not(stage0))]
419+
pub fn copysignf64(x: f64) -> f64;
420+
416421
pub fn floorf32(x: f32) -> f32;
417422
pub fn floorf64(x: f64) -> f64;
418423

@@ -422,6 +427,21 @@ extern "rust-intrinsic" {
422427
pub fn truncf32(x: f32) -> f32;
423428
pub fn truncf64(x: f64) -> f64;
424429

430+
#[cfg(not(stage0))]
431+
pub fn rintf32(x: f32) -> f32;
432+
#[cfg(not(stage0))]
433+
pub fn rintf64(x: f64) -> f64;
434+
435+
#[cfg(not(stage0))]
436+
pub fn nearbyintf32(x: f32) -> f32;
437+
#[cfg(not(stage0))]
438+
pub fn nearbyintf64(x: f64) -> f64;
439+
440+
#[cfg(not(stage0))]
441+
pub fn roundf32(x: f32) -> f32;
442+
#[cfg(not(stage0))]
443+
pub fn roundf64(x: f64) -> f64;
444+
425445
pub fn ctpop8(x: i8) -> i8;
426446
pub fn ctpop16(x: i16) -> i16;
427447
pub fn ctpop32(x: i32) -> i32;

branches/try2/src/libsyntax/ext/expand.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,11 +999,16 @@ pub fn std_macros() -> @str {
999999
macro_rules! writeln(($dst:expr, $($arg:tt)*) => (
10001000
format_args!(|args| { ::std::fmt::writeln($dst, args) }, $($arg)*)
10011001
))
1002+
// FIXME(#6846) once stdio is redesigned, this shouldn't perform an
1003+
// allocation but should rather delegate to an invocation of
1004+
// write! instead of format!
10021005
macro_rules! print (
1003-
($($arg:tt)*) => (format_args!(::std::rt::io::stdio::print_args, $($arg)*))
1006+
($($arg:tt)*) => (::std::io::print(format!($($arg)*)))
10041007
)
1008+
// FIXME(#6846) once stdio is redesigned, this shouldn't perform an
1009+
// allocation but should rather delegate to an io::Writer
10051010
macro_rules! println (
1006-
($($arg:tt)*) => (format_args!(::std::rt::io::stdio::println_args, $($arg)*))
1011+
($($arg:tt)*) => (::std::io::println(format!($($arg)*)))
10071012
)
10081013

10091014
macro_rules! local_data_key (

branches/try2/src/libsyntax/visit.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ pub trait Visitor<E:Clone> {
9090
walk_struct_def(self, s, i, g, n, e)
9191
}
9292
fn visit_struct_field(&mut self, s:@struct_field, e:E) { walk_struct_field(self, s, e) }
93-
fn visit_mac(&mut self, m:&mac, e:E) { walk_mac(self, m, e); }
9493
}
9594

9695
impl<E:Clone> Visitor<E> for @mut Visitor<E> {
@@ -151,9 +150,6 @@ impl<E:Clone> Visitor<E> for @mut Visitor<E> {
151150
fn visit_struct_field(&mut self, a:@struct_field, e:E) {
152151
(*self).visit_struct_field(a, e)
153152
}
154-
fn visit_mac(&mut self, macro:&mac, e:E) {
155-
(*self).visit_mac(macro, e);
156-
}
157153
}
158154

159155
pub fn walk_crate<E:Clone, V:Visitor<E>>(visitor: &mut V, crate: &Crate, env: E) {
@@ -251,7 +247,7 @@ pub fn walk_item<E:Clone, V:Visitor<E>>(visitor: &mut V, item: &item, env: E) {
251247
visitor.visit_trait_method(method, env.clone())
252248
}
253249
}
254-
item_mac(ref macro) => visitor.visit_mac(macro, env),
250+
item_mac(ref macro) => walk_mac(visitor, macro, env),
255251
}
256252
}
257253

@@ -511,7 +507,7 @@ pub fn walk_stmt<E:Clone, V:Visitor<E>>(visitor: &mut V, statement: &Stmt, env:
511507
StmtExpr(expression, _) | StmtSemi(expression, _) => {
512508
visitor.visit_expr(expression, env)
513509
}
514-
StmtMac(ref macro, _) => visitor.visit_mac(macro, env),
510+
StmtMac(ref macro, _) => walk_mac(visitor, macro, env),
515511
}
516512
}
517513

@@ -648,7 +644,7 @@ pub fn walk_expr<E:Clone, V:Visitor<E>>(visitor: &mut V, expression: @Expr, env:
648644
walk_expr_opt(visitor, optional_expression, env.clone())
649645
}
650646
ExprLogLevel => {}
651-
ExprMac(ref macro) => visitor.visit_mac(macro, env.clone()),
647+
ExprMac(ref macro) => walk_mac(visitor, macro, env.clone()),
652648
ExprParen(subexpression) => {
653649
visitor.visit_expr(subexpression, env.clone())
654650
}

branches/try2/src/test/compile-fail/asm-gated.rs

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

0 commit comments

Comments
 (0)