Skip to content

Commit 578008d

Browse files
committed
---
yaml --- r: 90735 b: refs/heads/master c: b5aa6eb h: refs/heads/master i: 90733: b2b25e2 90731: b870019 90727: 17ff87b 90719: 0f8181a v: v3
1 parent cfdde36 commit 578008d

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 02bdda27763bcb5d3038d6abd7b1c50d2c394a1c
2+
refs/heads/master: b5aa6eb69fce2a1cda2e12b770d5242ea14a3a3d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/src/librustc/metadata/encoder.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ pub struct EncodeParams<'a> {
6161
tcx: ty::ctxt,
6262
reexports2: middle::resolve::ExportMap2,
6363
item_symbols: &'a RefCell<HashMap<ast::NodeId, ~str>>,
64-
non_inlineable_statics: &'a HashSet<ast::NodeId>,
64+
non_inlineable_statics: &'a RefCell<HashSet<ast::NodeId>>,
6565
link_meta: &'a LinkMeta,
6666
cstore: @mut cstore::CStore,
6767
encode_inlined_item: encode_inlined_item<'a>,
@@ -90,7 +90,7 @@ pub struct EncodeContext<'a> {
9090
stats: @mut Stats,
9191
reexports2: middle::resolve::ExportMap2,
9292
item_symbols: &'a RefCell<HashMap<ast::NodeId, ~str>>,
93-
non_inlineable_statics: &'a HashSet<ast::NodeId>,
93+
non_inlineable_statics: &'a RefCell<HashSet<ast::NodeId>>,
9494
link_meta: &'a LinkMeta,
9595
cstore: &'a cstore::CStore,
9696
encode_inlined_item: encode_inlined_item<'a>,
@@ -923,7 +923,14 @@ fn encode_info_for_item(ecx: &EncodeContext,
923923
encode_name(ecx, ebml_w, item.ident);
924924
let elt = ast_map::path_pretty_name(item.ident, item.id as u64);
925925
encode_path(ecx, ebml_w, path, elt);
926-
if !ecx.non_inlineable_statics.contains(&item.id) {
926+
927+
let non_inlineable;
928+
{
929+
let non_inlineable_statics = ecx.non_inlineable_statics.borrow();
930+
non_inlineable = non_inlineable_statics.get().contains(&item.id);
931+
}
932+
933+
if !non_inlineable {
927934
(ecx.encode_inlined_item)(ecx, ebml_w, path, ii_item(item));
928935
}
929936
encode_visibility(ebml_w, vis);

trunk/src/librustc/middle/trans/base.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2545,7 +2545,10 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25452545

25462546
if !inlineable {
25472547
debug!("{} not inlined", sym);
2548-
ccx.non_inlineable_statics.insert(id);
2548+
let mut non_inlineable_statics =
2549+
ccx.non_inlineable_statics
2550+
.borrow_mut();
2551+
non_inlineable_statics.get().insert(id);
25492552
}
25502553

25512554
let mut item_symbols = ccx.item_symbols

trunk/src/librustc/middle/trans/consts.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,9 @@ pub fn get_const_val(cx: @mut CrateContext,
176176
}
177177

178178
let const_values = cx.const_values.borrow();
179+
let non_inlineable_statics = cx.non_inlineable_statics.borrow();
179180
(const_values.get().get_copy(&def_id.node),
180-
!cx.non_inlineable_statics.contains(&def_id.node))
181+
!non_inlineable_statics.get().contains(&def_id.node))
181182
}
182183

183184
pub fn const_expr(cx: @mut CrateContext, e: &ast::Expr) -> (ValueRef, bool) {

trunk/src/librustc/middle/trans/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ pub struct CrateContext {
6464
// A set of static items which cannot be inlined into other crates. This
6565
// will pevent in ii_item() structures from being encoded into the metadata
6666
// that is generated
67-
non_inlineable_statics: HashSet<ast::NodeId>,
67+
non_inlineable_statics: RefCell<HashSet<ast::NodeId>>,
6868
// Cache instances of monomorphized functions
6969
monomorphized: RefCell<HashMap<mono_id, ValueRef>>,
7070
monomorphizing: RefCell<HashMap<ast::DefId, uint>>,
@@ -192,7 +192,7 @@ impl CrateContext {
192192
finished_tydescs: false,
193193
external: HashMap::new(),
194194
external_srcs: HashMap::new(),
195-
non_inlineable_statics: HashSet::new(),
195+
non_inlineable_statics: RefCell::new(HashSet::new()),
196196
monomorphized: RefCell::new(HashMap::new()),
197197
monomorphizing: RefCell::new(HashMap::new()),
198198
vtables: RefCell::new(HashMap::new()),

0 commit comments

Comments
 (0)