diff options
| author | bors <bors@rust-lang.org> | 2014-07-03 19:56:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-03 19:56:47 +0000 |
| commit | dd812ccbb56193c36819993dea25912788b447f0 (patch) | |
| tree | 10d92c0c6c5e48e8025398ba87fbc3e0d824783c /src/rustllvm/ExecutionEngineWrapper.cpp | |
| parent | eda75bcf42ad99e3e4c99585d39705fccac606ee (diff) | |
| parent | 77f72d36ecd447877634d8e5c54b8d793e34cefa (diff) | |
| download | rust-dd812ccbb56193c36819993dea25912788b447f0.tar.gz rust-dd812ccbb56193c36819993dea25912788b447f0.zip | |
auto merge of #15076 : luqmana/rust/naim, r=pcwalton
```Rust
struct With {
x: int,
f: NoCopy
}
#[no_mangle]
fn bar() {
let mine = With { x: 3, f: NoCopy };
match mine {
c => {
foo(c);
}
}
}
#[no_mangle]
fn foo(_: With) {}
```
Before:
```LLVM
define internal void @bar() unnamed_addr #1 {
entry-block:
%mine = alloca %"struct.With<[]>"
%__llmatch = alloca %"struct.With<[]>"*
%c = alloca %"struct.With<[]>"
%0 = getelementptr inbounds %"struct.With<[]>"* %mine, i32 0, i32 0
store i64 3, i64* %0
%1 = getelementptr inbounds %"struct.With<[]>"* %mine, i32 0, i32 1
store %"struct.With<[]>"* %mine, %"struct.With<[]>"** %__llmatch
br label %case_body
case_body: ; preds = %entry-block
%2 = load %"struct.With<[]>"** %__llmatch
%3 = bitcast %"struct.With<[]>"* %2 to i8*
%4 = bitcast %"struct.With<[]>"* %c to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %4, i8* %3, i64 8, i32 8, i1 false)
%5 = load %"struct.With<[]>"* %c
call void @foo(%"struct.With<[]>" %5)
br label %join
join: ; preds = %case_body
ret void
}
```
After:
```LLVM
define internal void @bar() unnamed_addr #1 {
entry-block:
%mine = alloca %"struct.With<[]>"
%c = alloca %"struct.With<[]>"*
%0 = getelementptr inbounds %"struct.With<[]>"* %mine, i32 0, i32 0
store i64 3, i64* %0
%1 = getelementptr inbounds %"struct.With<[]>"* %mine, i32 0, i32 1
store %"struct.With<[]>"* %mine, %"struct.With<[]>"** %c
br label %case_body
case_body: ; preds = %entry-block
%2 = load %"struct.With<[]>"** %c
%3 = load %"struct.With<[]>"* %2
call void @foo(%"struct.With<[]>" %3)
br label %join
join: ; preds = %case_body
ret void
}
```
r? @pcwalton
Diffstat (limited to 'src/rustllvm/ExecutionEngineWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
