Skip to content

Commit 1e3d505

Browse files
committed
---
yaml --- r: 51105 b: refs/heads/try c: 499f96d h: refs/heads/master i: 51103: 9f8f84c v: v3
1 parent 2e4fcf8 commit 1e3d505

File tree

20 files changed

+168
-253
lines changed

20 files changed

+168
-253
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 5f13e9ccc2e3328d4cd8ca49f84e6840dd998346
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: f7a2371c176663d59062ec5158f39faecba45768
5-
refs/heads/try: 7a6cd2b21e240d3b075b30d598e661b038fe6fbe
5+
refs/heads/try: 499f96dca12210df847c05ebf7649c7b0af860f7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/RELEASES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Version 0.6 (April 2013)
1+
Version 0.6 (March 2013)
22
---------------------------
33

44
* ~2100 changes, numerous bugfixes

branches/try/src/libcore/str.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -726,8 +726,7 @@ pub fn each_split_within<'a>(ss: &'a str,
726726

727727
(B, Cr, UnderLim) => { B }
728728
(B, Cr, OverLim) if (i - last_start + 1) > lim
729-
=> fail!(fmt!("word starting with %? longer than limit!",
730-
self::slice(ss, last_start, i + 1))),
729+
=> { fail!(~"word longer than limit!") }
731730
(B, Cr, OverLim) => { slice(); slice_start = last_start; B }
732731
(B, Ws, UnderLim) => { last_end = i; C }
733732
(B, Ws, OverLim) => { last_end = i; slice(); A }

branches/try/src/libcore/unstable/lang.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ pub unsafe fn fail_borrowed() {
6464

6565
// FIXME #4942: Make these signatures agree with exchange_alloc's signatures
6666
#[lang="exchange_malloc"]
67-
#[inline(always)]
6867
pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char {
6968
transmute(exchange_alloc::malloc(transmute(td), transmute(size)))
7069
}
@@ -73,13 +72,11 @@ pub unsafe fn exchange_malloc(td: *c_char, size: uintptr_t) -> *c_char {
7372
// inside a landing pad may corrupt the state of the exception handler. If a
7473
// problem occurs, call exit instead.
7574
#[lang="exchange_free"]
76-
#[inline(always)]
7775
pub unsafe fn exchange_free(ptr: *c_char) {
7876
exchange_alloc::free(transmute(ptr))
7977
}
8078

8179
#[lang="malloc"]
82-
#[inline(always)]
8380
pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char {
8481
return rustrt::rust_upcall_malloc(td, size);
8582
}
@@ -88,7 +85,6 @@ pub unsafe fn local_malloc(td: *c_char, size: uintptr_t) -> *c_char {
8885
// inside a landing pad may corrupt the state of the exception handler. If a
8986
// problem occurs, call exit instead.
9087
#[lang="free"]
91-
#[inline(always)]
9288
pub unsafe fn local_free(ptr: *c_char) {
9389
rustrt::rust_upcall_free(ptr);
9490
}
@@ -121,7 +117,6 @@ pub unsafe fn check_not_borrowed(a: *u8) {
121117
}
122118

123119
#[lang="strdup_uniq"]
124-
#[inline(always)]
125120
pub unsafe fn strdup_uniq(ptr: *c_uchar, len: uint) -> ~str {
126121
str::raw::from_buf_len(ptr, len)
127122
}

branches/try/src/librustc/driver/driver.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,8 @@ pub fn optgroups() -> ~[getopts::groups::OptGroup] {
762762
optflag(~"", ~"test", ~"Build a test harness"),
763763
optopt(~"", ~"target",
764764
~"Target triple cpu-manufacturer-kernel[-os]
765-
to compile for (see chapter 3.4 of http://www.sourceware.org/autobook/
765+
to compile for (see
766+
http://sources.redhat.com/autobook/autobook/autobook_17.html
766767
for detail)", ~"TRIPLE"),
767768
optopt(~"", ~"android-cross-path",
768769
~"The path to the Android NDK", "PATH"),

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

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,11 +1306,11 @@ pub impl Liveness {
13061306
self.propagate_through_expr(e, succ)
13071307
}
13081308

1309-
expr_inline_asm(ref ia) =>{
1310-
let succ = do ia.inputs.foldr(succ) |&(_, expr), succ| {
1309+
expr_inline_asm(_, ref ins, ref outs, _, _, _) =>{
1310+
let succ = do ins.foldr(succ) |&(_, expr), succ| {
13111311
self.propagate_through_expr(expr, succ)
13121312
};
1313-
do ia.outputs.foldr(succ) |&(_, expr), succ| {
1313+
do outs.foldr(succ) |&(_, expr), succ| {
13141314
self.propagate_through_expr(expr, succ)
13151315
}
13161316
}
@@ -1580,19 +1580,14 @@ fn check_expr(expr: @expr, &&self: @Liveness, vt: vt<@Liveness>) {
15801580
visit::visit_expr(expr, self, vt);
15811581
}
15821582

1583-
expr_inline_asm(ref ia) => {
1584-
for ia.inputs.each |&(_, in)| {
1583+
expr_inline_asm(_, ref ins, ref outs, _, _, _) => {
1584+
for ins.each |&(_, in)| {
15851585
(vt.visit_expr)(in, self, vt);
15861586
}
15871587

15881588
// Output operands must be lvalues
1589-
for ia.outputs.each |&(_, out)| {
1590-
match out.node {
1591-
expr_addr_of(_, inner) => {
1592-
self.check_lvalue(inner, vt);
1593-
}
1594-
_ => {}
1595-
}
1589+
for outs.each |&(_, out)| {
1590+
self.check_lvalue(out, vt);
15961591
(vt.visit_expr)(out, self, vt);
15971592
}
15981593

branches/try/src/librustc/middle/trans/asm.rs

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

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

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ use metadata::csearch;
128128
use middle::borrowck::root_map_key;
129129
use middle::trans::_match;
130130
use middle::trans::adt;
131-
use middle::trans::asm;
132131
use middle::trans::base;
133132
use middle::trans::base::*;
134133
use middle::trans::build::*;
@@ -549,8 +548,108 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
549548
ast::expr_paren(a) => {
550549
return trans_rvalue_stmt_unadjusted(bcx, a);
551550
}
552-
ast::expr_inline_asm(ref a) => {
553-
return asm::trans_inline_asm(bcx, a);
551+
ast::expr_inline_asm(asm, ref ins, ref outs,
552+
clobs, volatile, alignstack) => {
553+
let mut constraints = ~[];
554+
let mut cleanups = ~[];
555+
let mut aoutputs = ~[];
556+
557+
let outputs = do outs.map |&(c, out)| {
558+
constraints.push(copy *c);
559+
560+
let aoutty = ty::arg {
561+
mode: ast::expl(ast::by_copy),
562+
ty: expr_ty(bcx, out)
563+
};
564+
aoutputs.push(unpack_result!(bcx, {
565+
callee::trans_arg_expr(bcx, aoutty, out, &mut cleanups,
566+
None, callee::DontAutorefArg)
567+
}));
568+
569+
let e = match out.node {
570+
ast::expr_addr_of(_, e) => e,
571+
_ => fail!(~"Expression must be addr of")
572+
};
573+
574+
let outty = ty::arg {
575+
mode: ast::expl(ast::by_copy),
576+
ty: expr_ty(bcx, e)
577+
};
578+
579+
unpack_result!(bcx, {
580+
callee::trans_arg_expr(bcx, outty, e, &mut cleanups,
581+
None, callee::DontAutorefArg)
582+
})
583+
584+
};
585+
586+
for cleanups.each |c| {
587+
revoke_clean(bcx, *c);
588+
}
589+
cleanups = ~[];
590+
591+
let inputs = do ins.map |&(c, in)| {
592+
constraints.push(copy *c);
593+
594+
let inty = ty::arg {
595+
mode: ast::expl(ast::by_copy),
596+
ty: expr_ty(bcx, in)
597+
};
598+
599+
unpack_result!(bcx, {
600+
callee::trans_arg_expr(bcx, inty, in, &mut cleanups,
601+
None, callee::DontAutorefArg)
602+
})
603+
604+
};
605+
606+
for cleanups.each |c| {
607+
revoke_clean(bcx, *c);
608+
}
609+
610+
let mut constraints = str::connect(constraints, ",");
611+
612+
// Add the clobbers
613+
if *clobs != ~"" {
614+
if constraints == ~"" {
615+
constraints += *clobs;
616+
} else {
617+
constraints += ~"," + *clobs;
618+
}
619+
} else {
620+
constraints += *clobs;
621+
}
622+
623+
debug!("Asm Constraints: %?", constraints);
624+
625+
let output = if outputs.len() == 0 {
626+
T_void()
627+
} else if outputs.len() == 1 {
628+
val_ty(outputs[0])
629+
} else {
630+
T_struct(outputs.map(|o| val_ty(*o)))
631+
};
632+
633+
let r = do str::as_c_str(*asm) |a| {
634+
do str::as_c_str(constraints) |c| {
635+
InlineAsmCall(bcx, a, c, inputs, output, volatile,
636+
alignstack, lib::llvm::AD_ATT)
637+
}
638+
};
639+
640+
if outputs.len() == 1 {
641+
let op = PointerCast(bcx, aoutputs[0],
642+
T_ptr(val_ty(outputs[0])));
643+
Store(bcx, r, op);
644+
} else {
645+
for aoutputs.eachi |i, o| {
646+
let v = ExtractValue(bcx, r, i);
647+
let op = PointerCast(bcx, *o, T_ptr(val_ty(outputs[i])));
648+
Store(bcx, v, op);
649+
}
650+
}
651+
652+
return bcx;
554653
}
555654
_ => {
556655
bcx.tcx().sess.span_bug(

0 commit comments

Comments
 (0)