]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #12798 : pczarn/rust/inline-asm, r=alexcrichton
authorbors <bors@rust-lang.org>
Fri, 14 Mar 2014 01:41:35 +0000 (18:41 -0700)
committerbors <bors@rust-lang.org>
Fri, 14 Mar 2014 01:41:35 +0000 (18:41 -0700)
## read+write modifier '+'
This small sugar was left out in the original implementation (#5359).

When an output operand with the '+' modifier is encountered, we store the index of that operand alongside the expression to create and append an input operand later. The following lines are equivalent:
```
asm!("" : "+m"(expr));
asm!("" : "=m"(expr) : "0"(expr));
```
## misplaced options and clobbers give a warning
It's really annoying when a small typo might change behavior without any warning.
```
asm!("mov $1, $0" : "=r"(x) : "r"(8u) : "cc" , "volatile");
//~^ WARNING expected a clobber, but found an option
```
## liveness
Fixed incorrect order of propagation.
Sometimes it caused spurious warnings in code: `warning: value assigned to `i` is never read, #[warn(dead_assignment)] on by default`

~~Note: Rebased on top of another PR. (uses other changes)~~

* [x] Implement read+write
* [x] Warn about misplaced options
* [x] Fix liveness (`dead_assignment` lint)
* [x] Add all tests

1  2 
src/librustc/middle/liveness.rs

Simple merge