Skip to content

Commit f1c55c2

Browse files
committed
---
yaml --- r: 32351 b: refs/heads/dist-snap c: ac31fdd h: refs/heads/master i: 32349: 765aa65 32347: 788d1c1 32343: 0a7852b 32335: 6877eb3 32319: 8460f32 v: v3
1 parent 580eb14 commit f1c55c2

File tree

3 files changed

+30
-4
lines changed

3 files changed

+30
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: cd15eac9cf479feadffc546c05289f071601978a
10+
refs/heads/dist-snap: ac31fdd9c4e3efbab473614bf1a7386f18ac9ae9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rustc/middle/trans/base.rs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2504,11 +2504,39 @@ fn lval_static_fn_inner(bcx: block, fn_id: ast::def_id, id: ast::node_id,
25042504

25052505
// Check whether this fn has an inlined copy and, if so, redirect fn_id to
25062506
// the local id of the inlined copy.
2507+
let original_crate = fn_id.crate;
25072508
let fn_id = if fn_id.crate != ast::local_crate {
25082509
maybe_instantiate_inline(ccx, fn_id)
25092510
} else { fn_id };
25102511

2511-
if fn_id.crate == ast::local_crate && tys.len() > 0u {
2512+
let must_monomorphise = {
2513+
let local_with_type_params =
2514+
fn_id.crate == ast::local_crate && tys.len() > 0u;
2515+
2516+
// Rust intrinsic functions should always be monomorphised
2517+
let inlined_rust_intrinsic = {
2518+
if fn_id.crate == ast::local_crate
2519+
&& original_crate != ast::local_crate {
2520+
2521+
let map_node = session::expect(
2522+
ccx.sess,
2523+
ccx.tcx.items.find(fn_id.node),
2524+
|| fmt!("inlined item should be in ast map"));
2525+
2526+
match map_node {
2527+
ast_map::node_foreign_item(
2528+
_, ast::foreign_abi_rust_intrinsic, _) => true,
2529+
_ => false
2530+
}
2531+
} else {
2532+
false
2533+
}
2534+
};
2535+
2536+
local_with_type_params || inlined_rust_intrinsic
2537+
};
2538+
2539+
if must_monomorphise {
25122540
let mut {val, must_cast} =
25132541
monomorphic_fn(ccx, fn_id, tys, vtables, Some(id));
25142542
if must_cast {

branches/dist-snap/src/test/run-pass/intrinsic-atomics-cc.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// xfail-fast - check-fast doesn't understand aux-build
22
// aux-build:cci_intrinsic.rs
33

4-
// xfail-test
5-
64
use cci_intrinsic;
75
import cci_intrinsic::atomic_xchg;
86

0 commit comments

Comments
 (0)