Skip to content

Commit f5485e2

Browse files
committed
---
yaml --- r: 120630 b: refs/heads/dist-snap c: 2fd4841 h: refs/heads/master v: v3
1 parent b7d6296 commit f5485e2

Some content is hidden

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

65 files changed

+553
-680
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: 12467989c3562eee5d7556e20bdc5d0d115c2cf1
9+
refs/heads/dist-snap: 2fd484172406a25e11f0f83000daeef7a287aebb
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: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ 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+
100107
CFG_RLIB_GLOB=lib$(1)-*.rlib
101108

102109
# x86_64-unknown-linux-gnu configuration
@@ -509,21 +516,6 @@ CFG_LDPATH_x86_64-unknown-freebsd :=
509516
CFG_RUN_x86_64-unknown-freebsd=$(2)
510517
CFG_RUN_TARG_x86_64-unknown-freebsd=$(call CFG_RUN_x86_64-unknown-freebsd,,$(2))
511518

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-
527519
ifeq ($(CFG_CCACHE_CPP2),1)
528520
CCACHE_CPP2=1
529521
export CCACHE_CPP

branches/dist-snap/src/libcollections/lru_cache.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ impl<K: Hash + TotalEq, V> LruCache<K, V> {
9292
let cache = LruCache {
9393
map: HashMap::new(),
9494
max_size: capacity,
95-
head: unsafe{ mem::transmute(box mem::uninit::<LruEntry<K, V>>()) },
95+
head: unsafe{ mem::transmute(box mem::uninitialized::<LruEntry<K, V>>()) },
9696
};
9797
unsafe {
9898
(*cache.head).next = cache.head;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@
8888
//! ```
8989
//! extern crate collections;
9090
//!
91+
//! use collections::HashMap;
9192
//! use std::cell::RefCell;
9293
//!
9394
//! struct Graph {
94-
//! edges: Vec<(uint, uint)>,
95+
//! edges: HashMap<uint, uint>,
9596
//! span_tree_cache: RefCell<Option<Vec<(uint, uint)>>>
9697
//! }
9798
//!

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::finally::Finally;
23+
use std::unstable::finally::Finally;
2424
2525
(|| {
2626
// ...
@@ -75,7 +75,7 @@ impl<T> Finally<T> for fn() -> T {
7575
* # Example
7676
*
7777
* ```
78-
* use std::finally::try_finally;
78+
* use std::unstable::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: 2 additions & 3 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, simd)]
56+
#![feature(globs, macro_rules, managed_boxes, phase)]
5757
#![deny(missing_doc)]
5858

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

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

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub fn size_of<T>() -> uint {
2626

2727
/// Returns the size of the type that `_val` points to in bytes.
2828
#[inline]
29-
#[unstable = "the name of this function may change slightly before stabilizing"]
29+
#[stable]
3030
pub fn size_of_val<T>(_val: &T) -> uint {
3131
size_of::<T>()
3232
}
@@ -64,7 +64,7 @@ pub fn min_align_of<T>() -> uint {
6464
/// Returns the ABI-required minimum alignment of the type of the value that
6565
/// `_val` points to
6666
#[inline]
67-
#[unstable = "the name of this function may change slightly before stabilizing"]
67+
#[stable]
6868
pub fn min_align_of_val<T>(_val: &T) -> uint {
6969
min_align_of::<T>()
7070
}
@@ -90,7 +90,7 @@ pub fn align_of<T>() -> uint {
9090
/// as trait objects (in the future), returning the alignment for an arbitrary
9191
/// value at runtime.
9292
#[inline]
93-
#[unstable = "the name of this function may change slightly before stabilizing"]
93+
#[stable]
9494
pub fn align_of_val<T>(_val: &T) -> uint {
9595
align_of::<T>()
9696
}
@@ -117,7 +117,7 @@ pub fn pref_align_of_val<T>(val: &T) -> uint { align_of_val(val) }
117117
///
118118
/// This is useful for FFI functions sometimes, but should generally be avoided.
119119
#[inline]
120-
#[unstable = "the name of this function is subject to change"]
120+
#[stable]
121121
pub unsafe fn zeroed<T>() -> T {
122122
intrinsics::init()
123123
}
@@ -136,7 +136,14 @@ pub unsafe fn init<T>() -> T { zeroed() }
136136
///
137137
/// This is useful for FFI functions sometimes, but should generally be avoided.
138138
#[inline]
139-
#[unstable = "the name of this function is subject to change"]
139+
#[stable]
140+
pub unsafe fn uninitialized<T>() -> T {
141+
intrinsics::uninit()
142+
}
143+
144+
/// Deprecated, use `uninitialized` instead.
145+
#[inline]
146+
#[deprecated = "this function has been renamed to `uninitialized`"]
140147
pub unsafe fn uninit<T>() -> T {
141148
intrinsics::uninit()
142149
}
@@ -148,7 +155,7 @@ pub unsafe fn uninit<T>() -> T {
148155
/// contained at the location `dst`. This could leak allocations or resources,
149156
/// so care must be taken to previously deallocate the value at `dst`.
150157
#[inline]
151-
#[unstable = "the name of this function is subject to change"]
158+
#[stable]
152159
pub unsafe fn overwrite<T>(dst: *mut T, src: T) {
153160
intrinsics::move_val_init(&mut *dst, src)
154161
}
@@ -315,7 +322,7 @@ pub fn from_be64(x: u64) -> u64 { x }
315322
pub fn swap<T>(x: &mut T, y: &mut T) {
316323
unsafe {
317324
// Give ourselves some scratch space to work with
318-
let mut t: T = uninit();
325+
let mut t: T = uninitialized();
319326

320327
// Perform the swap, `&mut` pointers never alias
321328
ptr::copy_nonoverlapping_memory(&mut t, &*x, 1);

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

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

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

13-
//! Operations on unsafe pointers, `*T`, and `*mut T`.
13+
//! Conveniences for working with unsafe pointers, the `*T`, and `*mut T` types.
1414
//!
15-
//! Working with unsafe pointers in Rust is uncommon,
16-
//! typically limited to a few patterns.
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.
1723
//!
1824
//! Use the [`null` function](fn.null.html) to create null pointers,
1925
//! the [`is_null`](trait.RawPtr.html#tymethod.is_null)
2026
//! and [`is_not_null`](trait.RawPtr.html#method.is_not_null)
2127
//! methods of the [`RawPtr` trait](trait.RawPtr.html) to check for null.
2228
//! The `RawPtr` trait is imported by the prelude, so `is_null` etc.
23-
//! work everywhere. The `RawPtr` also defines the `offset` method,
24-
//! for pointer math.
29+
//! work everywhere.
2530
//!
2631
//! # Common ways to create unsafe pointers
2732
//!
@@ -196,7 +201,7 @@ pub unsafe fn copy_memory<T>(dst: *mut T, src: *T, count: uint) {
196201
/// fn swap<T>(x: &mut T, y: &mut T) {
197202
/// unsafe {
198203
/// // Give ourselves some scratch space to work with
199-
/// let mut t: T = mem::uninit();
204+
/// let mut t: T = mem::uninitialized();
200205
///
201206
/// // Perform the swap, `&mut` pointers never alias
202207
/// ptr::copy_nonoverlapping_memory(&mut t, &*x, 1);
@@ -239,7 +244,7 @@ pub unsafe fn zero_memory<T>(dst: *mut T, count: uint) {
239244
#[inline]
240245
pub unsafe fn swap<T>(x: *mut T, y: *mut T) {
241246
// Give ourselves some scratch space to work with
242-
let mut tmp: T = mem::uninit();
247+
let mut tmp: T = mem::uninitialized();
243248
let t: *mut T = &mut tmp;
244249

245250
// Perform the swap
@@ -263,7 +268,7 @@ pub unsafe fn replace<T>(dest: *mut T, mut src: T) -> T {
263268
/// Reads the value from `*src` and returns it.
264269
#[inline(always)]
265270
pub unsafe fn read<T>(src: *T) -> T {
266-
let mut tmp: T = mem::uninit();
271+
let mut tmp: T = mem::uninitialized();
267272
copy_nonoverlapping_memory(&mut tmp, src, 1);
268273
tmp
269274
}
@@ -311,7 +316,7 @@ pub unsafe fn array_each<T>(arr: **T, cb: |*T|) {
311316
array_each_with_len(arr, len, cb);
312317
}
313318

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

branches/dist-snap/src/libnative/io/file_unix.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ impl rtio::RtioFileStream for FileDesc {
164164
}
165165

166166
fn fstat(&mut self) -> IoResult<io::FileStat> {
167-
let mut stat: libc::stat = unsafe { mem::uninit() };
167+
let mut stat: libc::stat = unsafe { mem::zeroed() };
168168
match retry(|| unsafe { libc::fstat(self.fd(), &mut stat) }) {
169169
0 => Ok(mkstat(&stat)),
170170
_ => Err(super::last_error()),
@@ -509,15 +509,15 @@ fn mkstat(stat: &libc::stat) -> io::FileStat {
509509
}
510510

511511
pub fn stat(p: &CString) -> IoResult<io::FileStat> {
512-
let mut stat: libc::stat = unsafe { mem::uninit() };
512+
let mut stat: libc::stat = unsafe { mem::zeroed() };
513513
match retry(|| unsafe { libc::stat(p.with_ref(|p| p), &mut stat) }) {
514514
0 => Ok(mkstat(&stat)),
515515
_ => Err(super::last_error()),
516516
}
517517
}
518518

519519
pub fn lstat(p: &CString) -> IoResult<io::FileStat> {
520-
let mut stat: libc::stat = unsafe { mem::uninit() };
520+
let mut stat: libc::stat = unsafe { mem::zeroed() };
521521
match retry(|| unsafe { libc::lstat(p.with_ref(|p| p), &mut stat) }) {
522522
0 => Ok(mkstat(&stat)),
523523
_ => Err(super::last_error()),

branches/dist-snap/src/libnative/io/file_win32.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl rtio::RtioFileStream for FileDesc {
195195
}
196196

197197
fn fstat(&mut self) -> IoResult<io::FileStat> {
198-
let mut stat: libc::stat = unsafe { mem::uninit() };
198+
let mut stat: libc::stat = unsafe { mem::zeroed() };
199199
match unsafe { libc::fstat(self.fd(), &mut stat) } {
200200
0 => Ok(mkstat(&stat)),
201201
_ => Err(super::last_error()),
@@ -510,7 +510,7 @@ fn mkstat(stat: &libc::stat) -> io::FileStat {
510510
}
511511

512512
pub fn stat(p: &CString) -> IoResult<io::FileStat> {
513-
let mut stat: libc::stat = unsafe { mem::uninit() };
513+
let mut stat: libc::stat = unsafe { mem::zeroed() };
514514
as_utf16_p(p.as_str().unwrap(), |up| {
515515
match unsafe { libc::wstat(up, &mut stat) } {
516516
0 => Ok(mkstat(&stat)),

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,8 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str,
254254
// The idea here is to avoid initializing threads that never
255255
// need to be initialized, particularly for larger regexs with
256256
// a lot of instructions.
257-
queue: unsafe { ::std::mem::uninit() },
258-
sparse: unsafe { ::std::mem::uninit() },
257+
queue: unsafe { ::std::mem::uninitialized() },
258+
sparse: unsafe { ::std::mem::uninitialized() },
259259
size: 0,
260260
}
261261
}

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

Lines changed: 15 additions & 36 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, uint64_t};
18+
use libc::{c_uint, c_ushort, c_void, free};
1919
use std::str::raw::from_c_str;
2020

2121
use middle::trans::type_::Type;
@@ -92,33 +92,6 @@ 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-
12295
// enum for the LLVM IntPredicate type
12396
pub enum IntPredicate {
12497
IntEQ = 32,
@@ -335,7 +308,7 @@ pub mod llvm {
335308
use super::{CodeGenModel, RelocMode, CodeGenOptLevel};
336309
use super::debuginfo::*;
337310
use libc::{c_char, c_int, c_longlong, c_ushort, c_uint, c_ulonglong,
338-
size_t, uint64_t};
311+
size_t};
339312

340313
// Link to our native llvm bindings (things that we need to use the C++ api
341314
// for) and because llvm is written in C++ we need to link against libstdc++
@@ -733,11 +706,20 @@ pub mod llvm {
733706
pub fn LLVMSetFunctionCallConv(Fn: ValueRef, CC: c_uint);
734707
pub fn LLVMGetGC(Fn: ValueRef) -> *c_char;
735708
pub fn LLVMSetGC(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);
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);
739712
pub fn LLVMGetFunctionAttr(Fn: ValueRef) -> c_ulonglong;
740713

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+
741723
/* Operations on parameters */
742724
pub fn LLVMCountParams(Fn: ValueRef) -> c_uint;
743725
pub fn LLVMGetParams(Fn: ValueRef, Params: *ValueRef);
@@ -801,9 +783,6 @@ pub mod llvm {
801783
pub fn LLVMSetInstrParamAlignment(Instr: ValueRef,
802784
index: c_uint,
803785
align: c_uint);
804-
pub fn LLVMAddCallSiteAttribute(Instr: ValueRef,
805-
index: c_uint,
806-
Val: uint64_t);
807786

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

18571836
pub fn SetFunctionAttribute(fn_: ValueRef, attr: Attribute) {
18581837
unsafe {
1859-
llvm::LLVMAddFunctionAttribute(fn_, FunctionIndex as c_uint, attr as uint64_t)
1838+
llvm::LLVMAddFunctionAttr(fn_, attr as c_uint)
18601839
}
18611840
}
18621841
/* Memory-managed object interface to type handles. */

0 commit comments

Comments
 (0)