Skip to content

Commit eed8514

Browse files
committed
---
yaml --- r: 49107 b: refs/heads/snap-stage3 c: 8c15409 h: refs/heads/master i: 49105: 3c301be 49103: f61238f v: v3
1 parent 94a858e commit eed8514

File tree

14 files changed

+141
-230
lines changed

14 files changed

+141
-230
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 63df1e9085c14b80cc86df55b234d16627f09b01
4+
refs/heads/snap-stage3: 8c1540985d9b5e05cbd6a9c8eea5e1ba96ed2fcd
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/RELEASES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ Version 0.6 (March 2013)
6262
* Pattern matching over vectors improved and expanded
6363
* Typechecking of closure types has been overhauled to
6464
improve inference and eliminate unsoundness
65+
* Macros leave scope at the end of modules, unless that module is
66+
tagged with #[macro_escape]
6567

6668
* Libraries
6769
* Added big integers to `std::bigint`

branches/snap-stage3/configure

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@ case $CFG_OSTYPE in
308308
esac
309309

310310

311-
if [ -z "$CFG_CPUTYPE" ]
312-
then
313311
case $CFG_CPUTYPE in
314312

315313
i386 | i486 | i686 | i786 | x86)
@@ -327,7 +325,6 @@ case $CFG_CPUTYPE in
327325
*)
328326
err "unknown CPU type: $CFG_CPUTYPE"
329327
esac
330-
fi
331328

332329
# Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
333330
if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]

branches/snap-stage3/src/librustc/middle/liveness.rs

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,11 +1346,11 @@ pub impl Liveness {
13461346
self.propagate_through_expr(e, succ)
13471347
}
13481348

1349-
expr_inline_asm(ref ia) =>{
1350-
let succ = do ia.inputs.foldr(succ) |&(_, expr), succ| {
1349+
expr_inline_asm(_, ref ins, ref outs, _, _, _) =>{
1350+
let succ = do ins.foldr(succ) |&(_, expr), succ| {
13511351
self.propagate_through_expr(expr, succ)
13521352
};
1353-
do ia.outputs.foldr(succ) |&(_, expr), succ| {
1353+
do outs.foldr(succ) |&(_, expr), succ| {
13541354
self.propagate_through_expr(expr, succ)
13551355
}
13561356
}
@@ -1620,19 +1620,14 @@ fn check_expr(expr: @expr, &&self: @Liveness, vt: vt<@Liveness>) {
16201620
visit::visit_expr(expr, self, vt);
16211621
}
16221622

1623-
expr_inline_asm(ref ia) => {
1624-
for ia.inputs.each |&(_, in)| {
1623+
expr_inline_asm(_, ref ins, ref outs, _, _, _) => {
1624+
for ins.each |&(_, in)| {
16251625
(vt.visit_expr)(in, self, vt);
16261626
}
16271627

16281628
// Output operands must be lvalues
1629-
for ia.outputs.each |&(_, out)| {
1630-
match out.node {
1631-
expr_addr_of(_, inner) => {
1632-
self.check_lvalue(inner, vt);
1633-
}
1634-
_ => {}
1635-
}
1629+
for outs.each |&(_, out)| {
1630+
self.check_lvalue(out, vt);
16361631
(vt.visit_expr)(out, self, vt);
16371632
}
16381633

branches/snap-stage3/src/librustc/middle/trans/asm.rs

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

branches/snap-stage3/src/librustc/middle/trans/expr.rs

Lines changed: 102 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ use lib::llvm::{ValueRef, TypeRef, llvm, True};
127127
use middle::borrowck::root_map_key;
128128
use middle::trans::_match;
129129
use middle::trans::adt;
130-
use middle::trans::asm;
131130
use middle::trans::base;
132131
use middle::trans::base::*;
133132
use middle::trans::build::*;
@@ -558,8 +557,108 @@ fn trans_rvalue_stmt_unadjusted(bcx: block, expr: @ast::expr) -> block {
558557
ast::expr_paren(a) => {
559558
return trans_rvalue_stmt_unadjusted(bcx, a);
560559
}
561-
ast::expr_inline_asm(ref a) => {
562-
return asm::trans_inline_asm(bcx, a);
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;
563662
}
564663
_ => {
565664
bcx.tcx().sess.span_bug(

branches/snap-stage3/src/librustc/middle/trans/type_use.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,11 @@ pub fn mark_for_expr(cx: Context, e: @expr) {
360360
mark_for_method_call(cx, e.id, e.callee_id);
361361
}
362362

363-
expr_inline_asm(ref ia) => {
364-
for ia.inputs.each |&(_, in)| {
363+
expr_inline_asm(_, ref ins, ref outs, _, _, _) => {
364+
for ins.each |&(_, in)| {
365365
node_type_needs(cx, use_repr, in.id);
366366
}
367-
for ia.outputs.each |&(_, out)| {
367+
for outs.each |&(_, out)| {
368368
node_type_needs(cx, use_repr, out.id);
369369
}
370370
}

branches/snap-stage3/src/librustc/middle/typeck/check/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2332,13 +2332,13 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
23322332
let region_lb = ty::re_scope(expr.id);
23332333
instantiate_path(fcx, pth, tpt, expr.span, expr.id, region_lb);
23342334
}
2335-
ast::expr_inline_asm(ref ia) => {
2335+
ast::expr_inline_asm(_, ref ins, ref outs, _, _, _) => {
23362336
fcx.require_unsafe(expr.span, ~"use of inline assembly");
23372337

2338-
for ia.inputs.each |&(_, in)| {
2338+
for ins.each |&(_, in)| {
23392339
check_expr(fcx, in);
23402340
}
2341-
for ia.outputs.each |&(_, out)| {
2341+
for outs.each |&(_, out)| {
23422342
check_expr(fcx, out);
23432343
}
23442344
fcx.write_nil(id);

branches/snap-stage3/src/librustc/rustc.rc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ pub mod middle {
8080
pub mod reachable;
8181
pub mod machine;
8282
pub mod adt;
83-
pub mod asm;
8483
}
8584
pub mod ty;
8685
pub mod resolve;

0 commit comments

Comments
 (0)