Skip to content

Commit 96be55b

Browse files
committed
---
yaml --- r: 120631 b: refs/heads/dist-snap c: e72a21b h: refs/heads/master i: 120629: b7d6296 120627: b0465a1 120623: fd16624 v: v3
1 parent f5485e2 commit 96be55b

Some content is hidden

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

55 files changed

+654
-520
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 1813e5aa1a03b0596b8de7abd1af31edf5d6098f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 2fd484172406a25e11f0f83000daeef7a287aebb
9+
refs/heads/dist-snap: e72a21b2bb6b889a991229a966a9243b6d81e4d0
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/mk/platform.mk

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,6 @@ endef
9797
$(foreach cvar,CC CXX CPP CFLAGS CXXFLAGS CPPFLAGS,\
9898
$(eval $(call SET_FROM_CFG,$(cvar))))
9999

100-
ifeq ($(CFG_USING_CLANG),1)
101-
# The -Qunused-arguments sidesteps spurious warnings from clang
102-
CFLAGS += -Qunused-arguments
103-
CXXFLAGS += -Qunused-arguments
104-
CPPFLAGS += -Qunused-arguments
105-
endif
106-
107100
CFG_RLIB_GLOB=lib$(1)-*.rlib
108101

109102
# x86_64-unknown-linux-gnu configuration
@@ -516,6 +509,21 @@ CFG_LDPATH_x86_64-unknown-freebsd :=
516509
CFG_RUN_x86_64-unknown-freebsd=$(2)
517510
CFG_RUN_TARG_x86_64-unknown-freebsd=$(call CFG_RUN_x86_64-unknown-freebsd,,$(2))
518511

512+
513+
# The -Qunused-arguments sidesteps spurious warnings from clang
514+
define FILTER_FLAGS
515+
ifeq ($$(CFG_USING_CLANG),1)
516+
ifneq ($(findstring clang,$$(shell $(CC_$(1)) -v)),)
517+
CFG_GCCISH_CFLAGS_$(1) += -Qunused-arguments
518+
CFG_GCCISH_CXXFLAGS_$(1) += -Qunused-arguments
519+
endif
520+
endif
521+
endef
522+
523+
$(foreach target,$(CFG_TARGET),\
524+
$(eval $(call FILTER_FLAGS,$(target))))
525+
526+
519527
ifeq ($(CFG_CCACHE_CPP2),1)
520528
CCACHE_CPP2=1
521529
export CCACHE_CPP

branches/dist-snap/src/libcore/cell.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,10 @@
8888
//! ```
8989
//! extern crate collections;
9090
//!
91-
//! use collections::HashMap;
9291
//! use std::cell::RefCell;
9392
//!
9493
//! struct Graph {
95-
//! edges: HashMap<uint, uint>,
94+
//! edges: Vec<(uint, uint)>,
9695
//! span_tree_cache: RefCell<Option<Vec<(uint, uint)>>>
9796
//! }
9897
//!

branches/dist-snap/src/libcore/finally.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ also be used. See that function for more details.
2020
# Example
2121
2222
```
23-
use std::unstable::finally::Finally;
23+
use std::finally::Finally;
2424
2525
(|| {
2626
// ...
@@ -75,7 +75,7 @@ impl<T> Finally<T> for fn() -> T {
7575
* # Example
7676
*
7777
* ```
78-
* use std::unstable::finally::try_finally;
78+
* use std::finally::try_finally;
7979
*
8080
* struct State<'a> { buffer: &'a mut [u8], len: uint }
8181
* # let mut buf = [];

branches/dist-snap/src/libcore/lib.rs

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

11-
//! The Rust Core Library
11+
//! # The Rust Core Library
1212
//!
1313
//! The Rust Core Library is the dependency-free foundation of [The
1414
//! Rust Standard Library](../std/index.html). It is the portable glue
@@ -53,7 +53,7 @@
5353
html_root_url = "http://doc.rust-lang.org/")]
5454

5555
#![no_std]
56-
#![feature(globs, macro_rules, managed_boxes, phase)]
56+
#![feature(globs, macro_rules, managed_boxes, phase, simd)]
5757
#![deny(missing_doc)]
5858

5959
#[cfg(test)] extern crate realcore = "core";
@@ -124,6 +124,7 @@ pub mod iter;
124124
pub mod option;
125125
pub mod raw;
126126
pub mod result;
127+
pub mod simd;
127128
pub mod slice;
128129
pub mod str;
129130
pub mod tuple;

branches/dist-snap/src/libcore/ptr.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,18 @@
1010

1111
// FIXME: talk about offset, copy_memory, copy_nonoverlapping_memory
1212

13-
//! Conveniences for working with unsafe pointers, the `*T`, and `*mut T` types.
13+
//! Operations on unsafe pointers, `*T`, and `*mut T`.
1414
//!
15-
//! Working with unsafe pointers in Rust is fairly uncommon,
16-
//! and often limited to some narrow use cases: holding
17-
//! an unsafe pointer when safe pointers are unsuitable;
18-
//! checking for null; and converting back to safe pointers.
19-
//! As a result, there is not yet an abundance of library code
20-
//! for working with unsafe pointers, and in particular,
21-
//! since pointer math is fairly uncommon in Rust, it is not
22-
//! all that convenient.
15+
//! Working with unsafe pointers in Rust is uncommon,
16+
//! typically limited to a few patterns.
2317
//!
2418
//! Use the [`null` function](fn.null.html) to create null pointers,
2519
//! the [`is_null`](trait.RawPtr.html#tymethod.is_null)
2620
//! and [`is_not_null`](trait.RawPtr.html#method.is_not_null)
2721
//! methods of the [`RawPtr` trait](trait.RawPtr.html) to check for null.
2822
//! The `RawPtr` trait is imported by the prelude, so `is_null` etc.
29-
//! work everywhere.
23+
//! work everywhere. The `RawPtr` also defines the `offset` method,
24+
//! for pointer math.
3025
//!
3126
//! # Common ways to create unsafe pointers
3227
//!
@@ -316,7 +311,7 @@ pub unsafe fn array_each<T>(arr: **T, cb: |*T|) {
316311
array_each_with_len(arr, len, cb);
317312
}
318313

319-
/// Extension methods for raw pointers.
314+
/// Methods on raw pointers
320315
pub trait RawPtr<T> {
321316
/// Returns the null pointer.
322317
fn null() -> Self;

branches/dist-snap/src/libstd/unstable/simd.rs renamed to branches/dist-snap/src/libcore/simd.rs

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,54 +8,89 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! SIMD vectors
11+
//! SIMD vectors.
12+
//!
13+
//! These types can be used for accessing basic SIMD operations. Each of them
14+
//! implements the standard arithmetic operator traits (Add, Sub, Mul, Div,
15+
//! Rem, Shl, Shr) through compiler magic, rather than explicitly. Currently
16+
//! comparison operators are not implemented. To use SSE3+, you must enable
17+
//! the features, like `-C target-feature=sse3,sse4.1,sse4.2`, or a more
18+
//! specific `target-cpu`. No other SIMD intrinsics or high-level wrappers are
19+
//! provided beyond this module.
20+
//!
21+
//! ```rust
22+
//! #[allow(experimental)];
23+
//!
24+
//! fn main() {
25+
//! use std::simd::f32x4;
26+
//! let a = f32x4(40.0, 41.0, 42.0, 43.0);
27+
//! let b = f32x4(1.0, 1.1, 3.4, 9.8);
28+
//! println!("{}", a + b);
29+
//! }
30+
//! ```
31+
//!
32+
//! ## Stability Note
33+
//!
34+
//! These are all experimental. The inferface may change entirely, without
35+
//! warning.
1236
1337
#![allow(non_camel_case_types)]
38+
#![allow(missing_doc)]
1439

1540
#[experimental]
1641
#[simd]
42+
#[deriving(Show)]
1743
pub struct i8x16(pub i8, pub i8, pub i8, pub i8,
1844
pub i8, pub i8, pub i8, pub i8,
1945
pub i8, pub i8, pub i8, pub i8,
2046
pub i8, pub i8, pub i8, pub i8);
2147

2248
#[experimental]
2349
#[simd]
50+
#[deriving(Show)]
2451
pub struct i16x8(pub i16, pub i16, pub i16, pub i16,
2552
pub i16, pub i16, pub i16, pub i16);
2653

2754
#[experimental]
2855
#[simd]
56+
#[deriving(Show)]
2957
pub struct i32x4(pub i32, pub i32, pub i32, pub i32);
3058

3159
#[experimental]
3260
#[simd]
61+
#[deriving(Show)]
3362
pub struct i64x2(pub i64, pub i64);
3463

3564
#[experimental]
3665
#[simd]
66+
#[deriving(Show)]
3767
pub struct u8x16(pub u8, pub u8, pub u8, pub u8,
3868
pub u8, pub u8, pub u8, pub u8,
3969
pub u8, pub u8, pub u8, pub u8,
4070
pub u8, pub u8, pub u8, pub u8);
4171

4272
#[experimental]
4373
#[simd]
74+
#[deriving(Show)]
4475
pub struct u16x8(pub u16, pub u16, pub u16, pub u16,
4576
pub u16, pub u16, pub u16, pub u16);
4677

4778
#[experimental]
4879
#[simd]
80+
#[deriving(Show)]
4981
pub struct u32x4(pub u32, pub u32, pub u32, pub u32);
5082

5183
#[experimental]
5284
#[simd]
85+
#[deriving(Show)]
5386
pub struct u64x2(pub u64, pub u64);
5487

5588
#[experimental]
5689
#[simd]
90+
#[deriving(Show)]
5791
pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
5892

5993
#[experimental]
6094
#[simd]
95+
#[deriving(Show)]
6196
pub struct f64x2(pub f64, pub f64);

branches/dist-snap/src/librustc/lib/llvm.rs

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use std::c_str::ToCStr;
1616
use std::cell::RefCell;
1717
use collections::HashMap;
18-
use libc::{c_uint, c_ushort, c_void, free};
18+
use libc::{c_uint, c_ushort, c_void, free, uint64_t};
1919
use std::str::raw::from_c_str;
2020

2121
use middle::trans::type_::Type;
@@ -92,6 +92,33 @@ pub enum Attribute {
9292
NonLazyBindAttribute = 1 << 31,
9393
}
9494

95+
#[repr(u64)]
96+
pub enum OtherAttribute {
97+
// The following are not really exposed in
98+
// the LLVM c api so instead to add these
99+
// we call a wrapper function in RustWrapper
100+
// that uses the C++ api.
101+
SanitizeAddressAttribute = 1 << 32,
102+
MinSizeAttribute = 1 << 33,
103+
NoDuplicateAttribute = 1 << 34,
104+
StackProtectStrongAttribute = 1 << 35,
105+
SanitizeThreadAttribute = 1 << 36,
106+
SanitizeMemoryAttribute = 1 << 37,
107+
NoBuiltinAttribute = 1 << 38,
108+
ReturnedAttribute = 1 << 39,
109+
ColdAttribute = 1 << 40,
110+
BuiltinAttribute = 1 << 41,
111+
OptimizeNoneAttribute = 1 << 42,
112+
InAllocaAttribute = 1 << 43,
113+
NonNullAttribute = 1 << 44,
114+
}
115+
116+
#[repr(C)]
117+
pub enum AttributeSet {
118+
ReturnIndex = 0,
119+
FunctionIndex = !0
120+
}
121+
95122
// enum for the LLVM IntPredicate type
96123
pub enum IntPredicate {
97124
IntEQ = 32,
@@ -308,7 +335,7 @@ pub mod llvm {
308335
use super::{CodeGenModel, RelocMode, CodeGenOptLevel};
309336
use super::debuginfo::*;
310337
use libc::{c_char, c_int, c_longlong, c_ushort, c_uint, c_ulonglong,
311-
size_t};
338+
size_t, uint64_t};
312339

313340
// Link to our native llvm bindings (things that we need to use the C++ api
314341
// for) and because llvm is written in C++ we need to link against libstdc++
@@ -706,20 +733,11 @@ pub mod llvm {
706733
pub fn LLVMSetFunctionCallConv(Fn: ValueRef, CC: c_uint);
707734
pub fn LLVMGetGC(Fn: ValueRef) -> *c_char;
708735
pub fn LLVMSetGC(Fn: ValueRef, Name: *c_char);
709-
pub fn LLVMAddFunctionAttr(Fn: ValueRef, PA: c_uint);
710-
pub fn LLVMAddFunctionAttrString(Fn: ValueRef, Name: *c_char);
711-
pub fn LLVMRemoveFunctionAttrString(Fn: ValueRef, Name: *c_char);
736+
pub fn LLVMAddFunctionAttribute(Fn: ValueRef, index: c_uint, PA: uint64_t);
737+
pub fn LLVMAddFunctionAttrString(Fn: ValueRef, index: c_uint, Name: *c_char);
738+
pub fn LLVMRemoveFunctionAttrString(Fn: ValueRef, index: c_uint, Name: *c_char);
712739
pub fn LLVMGetFunctionAttr(Fn: ValueRef) -> c_ulonglong;
713740

714-
pub fn LLVMAddReturnAttribute(Fn: ValueRef, PA: c_uint);
715-
pub fn LLVMRemoveReturnAttribute(Fn: ValueRef, PA: c_uint);
716-
717-
pub fn LLVMAddColdAttribute(Fn: ValueRef);
718-
719-
pub fn LLVMRemoveFunctionAttr(Fn: ValueRef,
720-
PA: c_ulonglong,
721-
HighPA: c_ulonglong);
722-
723741
/* Operations on parameters */
724742
pub fn LLVMCountParams(Fn: ValueRef) -> c_uint;
725743
pub fn LLVMGetParams(Fn: ValueRef, Params: *ValueRef);
@@ -783,6 +801,9 @@ pub mod llvm {
783801
pub fn LLVMSetInstrParamAlignment(Instr: ValueRef,
784802
index: c_uint,
785803
align: c_uint);
804+
pub fn LLVMAddCallSiteAttribute(Instr: ValueRef,
805+
index: c_uint,
806+
Val: uint64_t);
786807

787808
/* Operations on call instructions (only) */
788809
pub fn LLVMIsTailCall(CallInst: ValueRef) -> Bool;
@@ -1835,7 +1856,7 @@ pub fn ConstFCmp(pred: RealPredicate, v1: ValueRef, v2: ValueRef) -> ValueRef {
18351856

18361857
pub fn SetFunctionAttribute(fn_: ValueRef, attr: Attribute) {
18371858
unsafe {
1838-
llvm::LLVMAddFunctionAttr(fn_, attr as c_uint)
1859+
llvm::LLVMAddFunctionAttribute(fn_, FunctionIndex as c_uint, attr as uint64_t)
18391860
}
18401861
}
18411862
/* Memory-managed object interface to type handles. */

branches/dist-snap/src/librustc/middle/trans/_match.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -810,6 +810,9 @@ fn enter_tuple_struct<'a, 'b>(
810810
ast::PatEnum(_, Some(ref elts)) => {
811811
Some(elts.iter().map(|x| (*x)).collect())
812812
}
813+
ast::PatEnum(_, None) => {
814+
Some(Vec::from_elem(n_elts, dummy))
815+
}
813816
_ => {
814817
assert_is_binding_or_wild(bcx, p);
815818
Some(Vec::from_elem(n_elts, dummy))
@@ -1117,7 +1120,7 @@ fn any_tuple_struct_pat(bcx: &Block, m: &[Match], col: uint) -> bool {
11171120
m.iter().any(|br| {
11181121
let pat = *br.pats.get(col);
11191122
match pat.node {
1120-
ast::PatEnum(_, Some(_)) => {
1123+
ast::PatEnum(_, _) => {
11211124
match bcx.tcx().def_map.borrow().find(&pat.id) {
11221125
Some(&ast::DefFn(..)) |
11231126
Some(&ast::DefStruct(..)) => true,

0 commit comments

Comments
 (0)