diff options
| author | Daniel Micay <danielmicay@gmail.com> | 2013-10-03 06:19:02 -0400 |
|---|---|---|
| committer | Daniel Micay <danielmicay@gmail.com> | 2013-10-03 06:27:00 -0400 |
| commit | f504461a40d0f6fd88983be6d744c8d62b430506 (patch) | |
| tree | 278ac3650fb82652071b5be5c33f6abad91b9cd9 /src/rt/sync/rust_thread.cpp | |
| parent | 249b356fb3dba0998dbaef34980c9dd1c1e42f48 (diff) | |
| download | rust-f504461a40d0f6fd88983be6d744c8d62b430506.tar.gz rust-f504461a40d0f6fd88983be6d744c8d62b430506.zip | |
make C-like enums immediate
This fixes two existing bugs along the way:
* The `transmute` intrinsic did not correctly handle casts of immediate
aggregates like newtype structs and tuples.
* The code for calling foreign functions used the wrong type to create
an `alloca` temporary
enum Foo { A, B }
fn foo() -> Foo { A }
Before:
; Function Attrs: nounwind uwtable
define void @_ZN3foo18hbedc642d5d9cf5aag4v0.0E(%enum.Foo* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
"function top level":
%2 = getelementptr inbounds %enum.Foo* %0, i64 0, i32 0
store i64 0, i64* %2, align 8
ret void
}
After:
; Function Attrs: nounwind readnone uwtable
define %enum.Foo @_ZN3foo18hbedc642d5d9cf5aag4v0.0E({ i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #0 {
"function top level":
ret %enum.Foo zeroinitializer
}
Diffstat (limited to 'src/rt/sync/rust_thread.cpp')
0 files changed, 0 insertions, 0 deletions
