Skip to content

Commit 9b057e4

Browse files
committed
---
yaml --- r: 139044 b: refs/heads/try2 c: 98900d5 h: refs/heads/master v: v3
1 parent f1060a5 commit 9b057e4

Some content is hidden

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

63 files changed

+131
-352
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: dc5ad5070d06015d6a45f656882ae245197d0ff8
8+
refs/heads/try2: 98900d55e7f08a4b4cb665152a01b0bbf655baae
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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/thread_local_storage.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ type pthread_key_t = c_ulong;
4040

4141
#[cfg(target_os="linux")]
4242
#[cfg(target_os="freebsd")]
43-
#[cfg(target_os="android")]
4443
#[allow(non_camel_case_types)] // foreign type
4544
type pthread_key_t = c_uint;
4645

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: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ impl<T> Map<uint, T> for TrieMap<T> {
137137
}
138138

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

193194
impl TrieSet {
195+
/// Create an empty TrieSet
196+
#[inline(always)]
197+
static pure fn new() -> TrieSet {
198+
TrieSet{map: TrieMap::new()}
199+
}
200+
194201
/// Return true if the set contains a value
195202
#[inline(always)]
196203
pure fn contains(&self, value: &uint) -> bool {

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

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

Lines changed: 11 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -557,109 +557,6 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
557557
ast::expr_paren(a) => {
558558
return trans_rvalue_stmt_unadjusted(bcx, a);
559559
}
560-
ast::expr_inline_asm(asm, ref ins, ref outs,
561-
clobs, volatile, alignstack) => {
562-
let mut constraints = ~[];
563-
let mut cleanups = ~[];
564-
let mut aoutputs = ~[];
565-
566-
let outputs = do outs.map |&(c, out)| {
567-
constraints.push(copy *c);
568-
569-
let aoutty = ty::arg {
570-
mode: ast::expl(ast::by_copy),
571-
ty: expr_ty(bcx, out)
572-
};
573-
aoutputs.push(unpack_result!(bcx, {
574-
callee::trans_arg_expr(bcx, aoutty, out, &mut cleanups,
575-
None, callee::DontAutorefArg)
576-
}));
577-
578-
let e = match out.node {
579-
ast::expr_addr_of(_, e) => e,
580-
_ => fail!(~"Expression must be addr of")
581-
};
582-
583-
let outty = ty::arg {
584-
mode: ast::expl(ast::by_copy),
585-
ty: expr_ty(bcx, e)
586-
};
587-
588-
unpack_result!(bcx, {
589-
callee::trans_arg_expr(bcx, outty, e, &mut cleanups,
590-
None, callee::DontAutorefArg)
591-
})
592-
593-
};
594-
595-
for cleanups.each |c| {
596-
revoke_clean(bcx, *c);
597-
}
598-
cleanups = ~[];
599-
600-
let inputs = do ins.map |&(c, in)| {
601-
constraints.push(copy *c);
602-
603-
let inty = ty::arg {
604-
mode: ast::expl(ast::by_copy),
605-
ty: expr_ty(bcx, in)
606-
};
607-
608-
unpack_result!(bcx, {
609-
callee::trans_arg_expr(bcx, inty, in, &mut cleanups,
610-
None, callee::DontAutorefArg)
611-
})
612-
613-
};
614-
615-
for cleanups.each |c| {
616-
revoke_clean(bcx, *c);
617-
}
618-
619-
let mut constraints = str::connect(constraints, ",");
620-
621-
// Add the clobbers
622-
if *clobs != ~"" {
623-
if constraints == ~"" {
624-
constraints += *clobs;
625-
} else {
626-
constraints += ~"," + *clobs;
627-
}
628-
} else {
629-
constraints += *clobs;
630-
}
631-
632-
debug!("Asm Constraints: %?", constraints);
633-
634-
let output = if outputs.len() == 0 {
635-
T_void()
636-
} else if outputs.len() == 1 {
637-
val_ty(outputs[0])
638-
} else {
639-
T_struct(outputs.map(|o| val_ty(*o)))
640-
};
641-
642-
let r = do str::as_c_str(*asm) |a| {
643-
do str::as_c_str(constraints) |c| {
644-
InlineAsmCall(bcx, a, c, inputs, output, volatile,
645-
alignstack, lib::llvm::AD_ATT)
646-
}
647-
};
648-
649-
if outputs.len() == 1 {
650-
let op = PointerCast(bcx, aoutputs[0],
651-
T_ptr(val_ty(outputs[0])));
652-
Store(bcx, r, op);
653-
} else {
654-
for aoutputs.eachi |i, o| {
655-
let v = ExtractValue(bcx, r, i);
656-
let op = PointerCast(bcx, *o, T_ptr(val_ty(outputs[i])));
657-
Store(bcx, v, op);
658-
}
659-
}
660-
661-
return bcx;
662-
}
663560
_ => {
664561
bcx.tcx().sess.span_bug(
665562
expr.span,
@@ -794,6 +691,17 @@ fn trans_rvalue_dps_unadjusted(bcx: block, expr: @ast::expr,
794691
ast::expr_assign_op(op, dst, src) => {
795692
return trans_assign_op(bcx, expr, op, dst, src);
796693
}
694+
ast::expr_inline_asm(asm, cons, volatile, alignstack) => {
695+
// XXX: cons doesn't actual contain ALL the stuff we should
696+
// be passing since the constraints for in/outputs aren't included
697+
do str::as_c_str(*asm) |a| {
698+
do str::as_c_str(*cons) |c| {
699+
InlineAsmCall(bcx, a, c, volatile, alignstack,
700+
lib::llvm::AD_ATT);
701+
}
702+
}
703+
return bcx;
704+
}
797705
_ => {
798706
bcx.tcx().sess.span_bug(
799707
expr.span,

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -348,22 +348,12 @@ pub fn mark_for_expr(cx: Context, e: @expr) {
348348
}
349349
mark_for_method_call(cx, e.id, e.callee_id);
350350
}
351-
352-
expr_inline_asm(_, ref ins, ref outs, _, _, _) => {
353-
for ins.each |&(_, in)| {
354-
node_type_needs(cx, use_repr, in.id);
355-
}
356-
for outs.each |&(_, out)| {
357-
node_type_needs(cx, use_repr, out.id);
358-
}
359-
}
360-
361351
expr_paren(e) => mark_for_expr(cx, e),
362352

363353
expr_match(*) | expr_block(_) | expr_if(*) | expr_while(*) |
364354
expr_break(_) | expr_again(_) | expr_unary(_, _) | expr_lit(_) |
365355
expr_mac(_) | expr_addr_of(_, _) | expr_ret(_) | expr_loop(_, _) |
366-
expr_loop_body(_) | expr_do_body(_) => ()
356+
expr_loop_body(_) | expr_do_body(_) | expr_inline_asm(*) => ()
367357
}
368358
}
369359

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3102,6 +3102,7 @@ pub fn expr_kind(tcx: ctxt,
31023102
ast::expr_block(*) |
31033103
ast::expr_copy(*) |
31043104
ast::expr_repeat(*) |
3105+
ast::expr_inline_asm(*) |
31053106
ast::expr_lit(@codemap::spanned {node: lit_str(_), _}) |
31063107
ast::expr_vstore(_, ast::expr_vstore_slice) |
31073108
ast::expr_vstore(_, ast::expr_vstore_mut_slice) |
@@ -3144,7 +3145,6 @@ pub fn expr_kind(tcx: ctxt,
31443145
ast::expr_loop(*) |
31453146
ast::expr_assign(*) |
31463147
ast::expr_swap(*) |
3147-
ast::expr_inline_asm(*) |
31483148
ast::expr_assign_op(*) => {
31493149
RvalueStmtExpr
31503150
}

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,15 +2317,8 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
23172317
let region_lb = ty::re_scope(expr.id);
23182318
instantiate_path(fcx, pth, tpt, expr.span, expr.id, region_lb);
23192319
}
2320-
ast::expr_inline_asm(_, ins, outs, _, _, _) => {
2320+
ast::expr_inline_asm(*) => {
23212321
fcx.require_unsafe(expr.span, ~"use of inline assembly");
2322-
2323-
for ins.each |&(_, in)| {
2324-
check_expr(fcx, in);
2325-
}
2326-
for outs.each |&(_, out)| {
2327-
check_expr(fcx, out);
2328-
}
23292322
fcx.write_nil(id);
23302323
}
23312324
ast::expr_mac(_) => tcx.sess.bug(~"unexpanded macro"),

0 commit comments

Comments
 (0)