Last active

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View gist:b7571a7b5998bfc7b9ac
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#[crate_type="lib"];
 
pub struct Foo {
x: uint,
y: uint
}
 
#[inline(never)]
#[no_mangle]
pub fn foo(f: Foo) -> Foo {
f
}
 
#[no_mangle]
pub fn bar(f: Foo) -> Foo {
foo(f)
}
View gist:b7571a7b5998bfc7b9ac
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
; Function Attrs: noinline nounwind uwtable
define void @foo(%struct.Foo* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Foo* nocapture readonly) unnamed_addr #1 {
"function top level":
%3 = bitcast %struct.Foo* %2 to i8*
%4 = bitcast %struct.Foo* %0 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %4, i8* %3, i64 16, i32 8, i1 false)
ret void
}
 
; Function Attrs: nounwind uwtable
define void @bar(%struct.Foo* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone, %struct.Foo* nocapture readonly) unnamed_addr #2 {
"function top level":
%__self = alloca %struct.Foo, align 8
%3 = bitcast %struct.Foo* %2 to i8*
%4 = bitcast %struct.Foo* %__self to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %4, i8* %3, i64 16, i32 8, i1 false)
call void @foo(%struct.Foo* sret %0, { i64, %tydesc*, i8*, i8*, i8 }* undef, %struct.Foo* %__self)
ret void
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.