Skip to content

Commit f187459

Browse files
committed
---
yaml --- r: 80866 b: refs/heads/try c: 22b6f74 h: refs/heads/master v: v3
1 parent 3461063 commit f187459

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: b2eb1c01a45cbb7bfc40f24073b60de61e3fad47
5+
refs/heads/try: 22b6f7481f592babf2b4e230120597c47750dae1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/trans/callee.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,12 +706,15 @@ pub fn trans_call_inner(in_cx: @mut Block,
706706
_ => {}
707707
}
708708

709-
// Invoke the actual rust fn and update bcx/llresult.
709+
// A function pointer is called without the declaration available, so we have to apply
710+
// any attributes with ABI implications directly to the call instruction. Right now, the
711+
// only attribute we need to worry about is `sret`.
710712
let mut attrs = ~[];
711713
if type_of::return_uses_outptr(in_cx.tcx(), ret_ty) {
712714
attrs.push((1, StructRetAttribute));
713715
}
714716

717+
// The `noalias` attribute on the return value is useful to a function ptr caller.
715718
match ty::get(ret_ty).sty {
716719
// `~` pointer return values never alias because ownership is transferred
717720
ty::ty_uniq(*) |
@@ -721,6 +724,7 @@ pub fn trans_call_inner(in_cx: @mut Block,
721724
_ => ()
722725
}
723726

727+
// Invoke the actual rust fn and update bcx/llresult.
724728
let (llret, b) = base::invoke(bcx, llfn, llargs, attrs);
725729
bcx = b;
726730
llresult = llret;

branches/try/src/librustc/middle/trans/foreign.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ pub fn trans_native_call(bcx: @mut Block,
264264
}
265265
};
266266

267+
// A function pointer is called without the declaration available, so we have to apply
268+
// any attributes with ABI implications directly to the call instruction. Right now, the
269+
// only attribute we need to worry about is `sret`.
267270
let attrs;
268271
if fn_type.sret {
269272
attrs = &[(1, StructRetAttribute)];

0 commit comments

Comments
 (0)