Skip to content

Commit 2897dd7

Browse files
committed
---
yaml --- r: 57625 b: refs/heads/incoming c: 0b0ca59 h: refs/heads/master i: 57623: b855c1d v: v3
1 parent 2e8c9c3 commit 2897dd7

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: bf67eb2362b7d0f37012f2d6dac604c3bbacd2c6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/incoming: ca8e99fd78ab9b56c5bdc61027b032ad52c2ec8b
9+
refs/heads/incoming: 0b0ca597bf25d13e4493c72843389cc9e47425b6
1010
refs/heads/dist-snap: 00dbbd01c2aee72982b3e0f9511ae1d4428c3ba9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/librustc/middle/trans/closure.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,15 @@ pub fn trans_expr_fn(bcx: block,
409409
~"expr_fn");
410410
let llfn = decl_internal_cdecl_fn(ccx.llmod, s, llfnty);
411411

412+
// Always mark inline if this is a loop body. This is important for
413+
// performance on many programs with tight loops.
414+
if is_loop_body.is_some() {
415+
set_always_inline(llfn);
416+
} else {
417+
// Can't hurt.
418+
set_inline_hint(llfn);
419+
}
420+
412421
let Result {bcx: bcx, val: closure} = match sigil {
413422
ast::BorrowedSigil | ast::ManagedSigil | ast::OwnedSigil => {
414423
let cap_vars = *ccx.maps.capture_map.get(&user_id);

0 commit comments

Comments
 (0)