Skip to content

Commit f1ff255

Browse files
committed
---
yaml --- r: 80622 b: refs/heads/auto c: d1c0550 h: refs/heads/master v: v3
1 parent bfd5a75 commit f1ff255

File tree

21 files changed

+392
-1509
lines changed

21 files changed

+392
-1509
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: c0ec40f74bd33317fb0af76a68d29bfbaf211b58
16+
refs/heads/auto: d1c05504ba0ec65aac73ebaac82cbac7602d0f87
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/mk/platform.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,11 @@ else
4747
CFG_GCCISH_CFLAGS += -O2
4848
endif
4949

50+
# The soname thing is for supporting a statically linked jemalloc.
51+
# see https://blog.mozilla.org/jseward/2012/06/05/valgrind-now-supports-jemalloc-builds-directly/
5052
ifdef CFG_VALGRIND
5153
CFG_VALGRIND += --error-exitcode=100 \
54+
--soname-synonyms=somalloc=NONE \
5255
--quiet \
5356
--suppressions=$(CFG_SRC_DIR)src/etc/x86.supp \
5457
$(OS_SUPP)

branches/auto/src/librustc/metadata/encoder.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub struct EncodeParams<'self> {
6060
reexports2: middle::resolve::ExportMap2,
6161
item_symbols: &'self HashMap<ast::NodeId, ~str>,
6262
discrim_symbols: &'self HashMap<ast::NodeId, @str>,
63+
non_inlineable_statics: &'self HashSet<ast::NodeId>,
6364
link_meta: &'self LinkMeta,
6465
cstore: @mut cstore::CStore,
6566
encode_inlined_item: encode_inlined_item<'self>,
@@ -89,6 +90,7 @@ pub struct EncodeContext<'self> {
8990
reexports2: middle::resolve::ExportMap2,
9091
item_symbols: &'self HashMap<ast::NodeId, ~str>,
9192
discrim_symbols: &'self HashMap<ast::NodeId, @str>,
93+
non_inlineable_statics: &'self HashSet<ast::NodeId>,
9294
link_meta: &'self LinkMeta,
9395
cstore: &'self cstore::CStore,
9496
encode_inlined_item: encode_inlined_item<'self>,
@@ -907,7 +909,9 @@ fn encode_info_for_item(ecx: &EncodeContext,
907909
encode_name(ecx, ebml_w, item.ident);
908910
let elt = ast_map::path_pretty_name(item.ident, item.id as u64);
909911
encode_path(ecx, ebml_w, path, elt);
910-
(ecx.encode_inlined_item)(ecx, ebml_w, path, ii_item(item));
912+
if !ecx.non_inlineable_statics.contains(&item.id) {
913+
(ecx.encode_inlined_item)(ecx, ebml_w, path, ii_item(item));
914+
}
911915
ebml_w.end_tag();
912916
}
913917
item_fn(_, purity, _, ref generics, _) => {
@@ -1728,6 +1732,7 @@ pub fn encode_metadata(parms: EncodeParams, crate: &Crate) -> ~[u8] {
17281732
encode_inlined_item,
17291733
link_meta,
17301734
reachable,
1735+
non_inlineable_statics,
17311736
_
17321737
} = parms;
17331738
let type_abbrevs = @mut HashMap::new();
@@ -1739,6 +1744,7 @@ pub fn encode_metadata(parms: EncodeParams, crate: &Crate) -> ~[u8] {
17391744
reexports2: reexports2,
17401745
item_symbols: item_symbols,
17411746
discrim_symbols: discrim_symbols,
1747+
non_inlineable_statics: non_inlineable_statics,
17421748
link_meta: link_meta,
17431749
cstore: cstore,
17441750
encode_inlined_item: encode_inlined_item,

branches/auto/src/librustc/middle/trans/_match.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,16 @@ fn trans_opt(bcx: @mut Block, o: &Opt) -> opt_result {
324324
return single_result(datumblock.to_result(bcx));
325325
}
326326
lit(ConstLit(lit_id)) => {
327-
let llval = consts::get_const_val(bcx.ccx(), lit_id);
327+
let (llval, _) = consts::get_const_val(bcx.ccx(), lit_id);
328328
return single_result(rslt(bcx, llval));
329329
}
330330
var(disr_val, repr) => {
331331
return adt::trans_case(bcx, repr, disr_val);
332332
}
333333
range(l1, l2) => {
334-
return range_result(rslt(bcx, consts::const_expr(ccx, l1)),
335-
rslt(bcx, consts::const_expr(ccx, l2)));
334+
let (l1, _) = consts::const_expr(ccx, l1);
335+
let (l2, _) = consts::const_expr(ccx, l2);
336+
return range_result(rslt(bcx, l1), rslt(bcx, l2));
336337
}
337338
vec_len(n, vec_len_eq, _) => {
338339
return single_result(rslt(bcx, C_int(ccx, n as int)));

branches/auto/src/librustc/middle/trans/base.rs

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,12 +2541,29 @@ pub fn get_item_val(ccx: @mut CrateContext, id: ast::NodeId) -> ValueRef {
25412541
let sym = exported_name(ccx, my_path, ty, i.attrs);
25422542

25432543
let v = match i.node {
2544-
ast::item_static(_, m, expr) => {
2544+
ast::item_static(_, _, expr) => {
2545+
// If this static came from an external crate, then
2546+
// we need to get the symbol from csearch instead of
2547+
// using the current crate's name/version
2548+
// information in the hash of the symbol
2549+
debug!("making %s", sym);
2550+
let sym = match ccx.external_srcs.find(&i.id) {
2551+
Some(&did) => {
2552+
debug!("but found in other crate...");
2553+
csearch::get_symbol(ccx.sess.cstore, did)
2554+
}
2555+
None => sym
2556+
};
2557+
25452558
// We need the translated value here, because for enums the
25462559
// LLVM type is not fully determined by the Rust type.
2547-
let v = consts::const_expr(ccx, expr);
2560+
let (v, inlineable) = consts::const_expr(ccx, expr);
25482561
ccx.const_values.insert(id, v);
2549-
exprt = (m == ast::MutMutable || i.vis == ast::public);
2562+
if !inlineable {
2563+
debug!("%s not inlined", sym);
2564+
ccx.non_inlineable_statics.insert(id);
2565+
}
2566+
exprt = true;
25502567

25512568
unsafe {
25522569
let llty = llvm::LLVMTypeOf(v);
@@ -2997,6 +3014,7 @@ pub fn crate_ctxt_to_encode_parms<'r>(cx: &'r CrateContext, ie: encoder::encode_
29973014
reexports2: cx.exp_map2,
29983015
item_symbols: item_symbols,
29993016
discrim_symbols: discrim_symbols,
3017+
non_inlineable_statics: &cx.non_inlineable_statics,
30003018
link_meta: link_meta,
30013019
cstore: cx.sess.cstore,
30023020
encode_inlined_item: ie,

0 commit comments

Comments
 (0)