Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add sret + noalias to the out pointer parameter
This brings Rust in line with how `clang` handles return pointers. Example: pub fn bar() -> [uint, .. 8] { let a = [0, .. 8]; a } Before: ; Function Attrs: nounwind uwtable define void @_ZN3bar17ha4635c6f704bfa334v0.0E([8 x i64]* nocapture, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #1 { "function top level": %a = alloca [8 x i64], align 8 %2 = bitcast [8 x i64]* %a to i8* call void @llvm.memset.p0i8.i64(i8* %2, i8 0, i64 64, i32 8, i1 false) %3 = bitcast [8 x i64]* %0 to i8* call void @llvm.memcpy.p0i8.p0i8.i64(i8* %3, i8* %2, i64 64, i32 8, i1 false) ret void } After: ; Function Attrs: nounwind uwtable define void @_ZN3bar17ha4635c6f704bfa334v0.0E([8 x i64]* noalias nocapture sret, { i64, %tydesc*, i8*, i8*, i8 }* nocapture readnone) #1 { "function top level": %2 = bitcast [8 x i64]* %0 to i8* call void @llvm.memset.p0i8.i64(i8* %2, i8 0, i64 64, i32 8, i1 false) ret void } Closes #9072 Closes #7298
- Loading branch information
a543ed6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from pcwalton
at https://github.com/thestinger/rust/commit/a543ed6caa6c35f1ec55ed02256f6c62078a23e8
a543ed6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging thestinger/rust/outptr = a543ed6 into auto
a543ed6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thestinger/rust/outptr = a543ed6 merged ok, testing candidate = 4e895d1d
a543ed6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/482
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1372
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1375
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/481
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/481
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1391
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/482
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1391
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/482
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/482
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/563
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/1375
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/481
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/481
exception: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/1160
a543ed6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from pcwalton
at https://github.com/thestinger/rust/commit/a543ed6caa6c35f1ec55ed02256f6c62078a23e8
a543ed6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging thestinger/rust/outptr = a543ed6 into auto
a543ed6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thestinger/rust/outptr = a543ed6 merged ok, testing candidate = c5247fda
a543ed6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/483
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/1373
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/1376
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/482
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/482
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/1392
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/483
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/1392
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/483
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/483
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/564
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/1376
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/482
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/482
exception: http://buildbot.rust-lang.org/builders/auto-bsd-64-opt/builds/1161