Skip to content

Commit 761dbee

Browse files
committed
---
yaml --- r: 80583 b: refs/heads/auto c: 22b6f74 h: refs/heads/master i: 80581: 2cec316 80579: b6b6de7 80575: fb5dcc2 v: v3
1 parent 3e04bc4 commit 761dbee

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
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: b2eb1c01a45cbb7bfc40f24073b60de61e3fad47
16+
refs/heads/auto: 22b6f7481f592babf2b4e230120597c47750dae1
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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)