Skip to content

Commit 519b906

Browse files
committed
---
yaml --- r: 139056 b: refs/heads/try2 c: 321a54d h: refs/heads/master v: v3
1 parent 4da73cf commit 519b906

Some content is hidden

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

71 files changed

+336
-559
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: f54adca7c984c75334d9cb73ec85bf3b5c326ed9
8+
refs/heads/try2: 321a54d26f1851f64feab6dba19b7af2e9e7c75f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/cleanup.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,11 @@ unsafe fn each_live_alloc(f: &fn(box: *mut BoxRepr, uniq: bool) -> bool) {
145145

146146
#[cfg(unix)]
147147
fn debug_mem() -> bool {
148-
::rt::env::get().debug_mem
148+
use os;
149+
use libc;
150+
do os::as_c_charp("RUST_DEBUG_MEM") |p| {
151+
unsafe { libc::getenv(p) != null() }
152+
}
149153
}
150154

151155
#[cfg(windows)]

branches/try2/src/libcore/clone.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ impl Clone for () {
2020
fn clone(&self) -> () { () }
2121
}
2222

23-
impl<T:Clone> Clone for ~T {
24-
#[inline(always)]
25-
fn clone(&self) -> ~T { ~(**self).clone() }
26-
}
27-
2823
macro_rules! clone_impl(
2924
($t:ty) => {
3025
impl Clone for $t {

branches/try2/src/libcore/rt/env.rs

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

branches/try2/src/libcore/rt/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,3 @@ mod work_queue;
4545
mod stack;
4646
mod context;
4747
mod thread;
48-
pub mod env;

branches/try2/src/libcore/str.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use at_vec;
2121
use cast;
2222
use char;
23-
use clone::Clone;
2423
use cmp::{Equiv, TotalOrd, Ordering, Less, Equal, Greater};
2524
use libc;
2625
use option::{None, Option, Some};
@@ -2437,13 +2436,6 @@ impl OwnedStr for ~str {
24372436
}
24382437
}
24392438
2440-
impl Clone for ~str {
2441-
#[inline(always)]
2442-
fn clone(&self) -> ~str {
2443-
self.to_str() // hilarious
2444-
}
2445-
}
2446-
24472439
#[cfg(test)]
24482440
mod tests {
24492441
use char;

branches/try2/src/libcore/trie.rs

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ impl<T> Map<uint, T> for TrieMap<T> {
137137
}
138138

139139
impl<T> TrieMap<T> {
140-
/// Create an empty TrieMap
141140
#[inline(always)]
142141
static pure fn new() -> TrieMap<T> {
143142
TrieMap{root: TrieNode::new(), length: 0}
@@ -192,12 +191,6 @@ impl Mutable for TrieSet {
192191
}
193192

194193
impl TrieSet {
195-
/// Create an empty TrieSet
196-
#[inline(always)]
197-
static pure fn new() -> TrieSet {
198-
TrieSet{map: TrieMap::new()}
199-
}
200-
201194
/// Return true if the set contains a value
202195
#[inline(always)]
203196
pure fn contains(&self, value: &uint) -> bool {
@@ -272,8 +265,8 @@ impl<T> TrieNode<T> {
272265
// if this was done via a trait, the key could be generic
273266
#[inline(always)]
274267
pure fn chunk(n: uint, idx: uint) -> uint {
275-
let sh = uint::bits - (SHIFT * (idx + 1));
276-
(n >> sh) & MASK
268+
let real_idx = uint::bytes - 1 - idx;
269+
(n >> (SHIFT * real_idx)) & MASK
277270
}
278271

279272
fn insert<T>(count: &mut uint, child: &mut Child<T>, key: uint, value: T,
@@ -469,26 +462,4 @@ mod tests {
469462
n -= 1;
470463
}
471464
}
472-
473-
#[test]
474-
fn test_sane_chunk() {
475-
let x = 1;
476-
let y = 1 << (uint::bits - 1);
477-
478-
let mut trie = TrieSet::new();
479-
480-
fail_unless!(trie.insert(x));
481-
fail_unless!(trie.insert(y));
482-
483-
fail_unless!(trie.len() == 2);
484-
485-
let expected = [x, y];
486-
487-
let mut i = 0;
488-
489-
for trie.each |x| {
490-
fail_unless!(expected[i] == *x);
491-
i += 1;
492-
}
493-
}
494465
}

branches/try2/src/libcore/unstable/global.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ unsafe fn global_data_clone_create_<T:Owned + Clone>(
6868
match value {
6969
None => {
7070
let value = create();
71-
clone_value = Some((*value).clone());
71+
clone_value = Some(value.clone());
7272
Some(value)
7373
}
7474
Some(value) => {
75-
clone_value = Some((*value).clone());
75+
clone_value = Some(value.clone());
7676
Some(value)
7777
}
7878
}
@@ -193,7 +193,7 @@ fn get_global_state() -> Exclusive<GlobalState> {
193193
// Successfully installed the global pointer
194194

195195
// Take a handle to return
196-
let clone = (*state).clone();
196+
let clone = state.clone();
197197

198198
// Install a runtime exit function to destroy the global object
199199
do at_exit {

branches/try2/src/libcore/vec.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use container::{Container, Mutable};
1616
use cast;
1717
use cmp::{Eq, Equiv, Ord, TotalOrd, Ordering, Less, Equal, Greater};
18-
use clone::Clone;
1918
use iter::BaseIter;
2019
use iter;
2120
use kinds::Copy;
@@ -2502,18 +2501,6 @@ impl<A:Copy> iter::CopyableNonstrictIter<A> for @[A] {
25022501
}
25032502
}
25042503

2505-
impl<A:Clone> Clone for ~[A] {
2506-
#[inline]
2507-
fn clone(&self) -> ~[A] {
2508-
let mut dolly = ~[];
2509-
vec::reserve(&mut dolly, self.len());
2510-
for self.each |item| {
2511-
dolly.push(item.clone());
2512-
}
2513-
return dolly;
2514-
}
2515-
}
2516-
25172504
// ___________________________________________________________________________
25182505

25192506
#[cfg(test)]

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

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,15 +1347,7 @@ pub impl Liveness {
13471347
self.propagate_through_expr(e, succ)
13481348
}
13491349
1350-
expr_inline_asm(_, ins, outs, _, _, _) =>{
1351-
let succ = do ins.foldr(succ) |&(_, expr), succ| {
1352-
self.propagate_through_expr(expr, succ)
1353-
};
1354-
do outs.foldr(succ) |&(_, expr), succ| {
1355-
self.propagate_through_expr(expr, succ)
1356-
}
1357-
}
1358-
1350+
expr_inline_asm(*) |
13591351
expr_lit(*) => {
13601352
succ
13611353
}
@@ -1621,20 +1613,6 @@ fn check_expr(expr: @expr, &&self: @Liveness, vt: vt<@Liveness>) {
16211613
visit::visit_expr(expr, self, vt);
16221614
}
16231615

1624-
expr_inline_asm(_, ins, outs, _, _, _) => {
1625-
for ins.each |&(_, in)| {
1626-
(vt.visit_expr)(in, self, vt);
1627-
}
1628-
1629-
// Output operands must be lvalues
1630-
for outs.each |&(_, out)| {
1631-
self.check_lvalue(out, vt);
1632-
(vt.visit_expr)(out, self, vt);
1633-
}
1634-
1635-
visit::visit_expr(expr, self, vt);
1636-
}
1637-
16381616
// no correctness conditions related to liveness
16391617
expr_call(*) | expr_method_call(*) | expr_if(*) | expr_match(*) |
16401618
expr_while(*) | expr_loop(*) | expr_index(*) | expr_field(*) |
@@ -1643,7 +1621,7 @@ fn check_expr(expr: @expr, &&self: @Liveness, vt: vt<@Liveness>) {
16431621
expr_cast(*) | expr_unary(*) | expr_ret(*) | expr_break(*) |
16441622
expr_again(*) | expr_lit(_) | expr_block(*) | expr_swap(*) |
16451623
expr_mac(*) | expr_addr_of(*) | expr_struct(*) | expr_repeat(*) |
1646-
expr_paren(*) => {
1624+
expr_paren(*) | expr_inline_asm(*) => {
16471625
visit::visit_expr(expr, self, vt);
16481626
}
16491627
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,10 @@ pub impl VisitContext {
558558
self.use_expr(base, Read, visitor);
559559
}
560560

561-
expr_inline_asm(*) |
562561
expr_break(*) |
563562
expr_again(*) |
564-
expr_lit(*) => {}
563+
expr_lit(*) |
564+
expr_inline_asm(*) => {}
565565

566566
expr_loop(ref blk, _) => {
567567
self.consume_block(blk, visitor);

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,6 @@ pub fn add_comment(bcx: block, text: &str) {
873873
}
874874
875875
pub fn InlineAsmCall(cx: block, asm: *c_char, cons: *c_char,
876-
inputs: &[ValueRef], output: TypeRef,
877876
volatile: bool, alignstack: bool,
878877
dia: AsmDialect) -> ValueRef {
879878
unsafe {
@@ -884,17 +883,11 @@ pub fn InlineAsmCall(cx: block, asm: *c_char, cons: *c_char,
884883
let alignstack = if alignstack { lib::llvm::True }
885884
else { lib::llvm::False };
886885
887-
let argtys = do inputs.map |v| {
888-
debug!("Asm Input Type: %?", val_str(cx.ccx().tn, *v));
889-
val_ty(*v)
890-
};
891-
892-
debug!("Asm Output Type: %?", ty_str(cx.ccx().tn, output));
893-
let llfty = T_fn(argtys, output);
886+
let llfty = T_fn(~[], T_void());
894887
let v = llvm::LLVMInlineAsm(llfty, asm, cons, volatile,
895888
alignstack, dia as c_uint);
896889
897-
Call(cx, v, inputs)
890+
Call(cx, v, ~[])
898891
}
899892
}
900893

0 commit comments

Comments
 (0)