Skip to content

Commit 495be6e

Browse files
committed
---
yaml --- r: 6919 b: refs/heads/master c: 8005f0c h: refs/heads/master i: 6917: e6046ad 6915: f83547d 6911: f33e750 v: v3
1 parent 09e2ed9 commit 495be6e

File tree

19 files changed

+338
-185
lines changed

19 files changed

+338
-185
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 07d7f828cd858bed67855e5a5ba24369625a981e
2+
refs/heads/master: 8005f0c564311fe2a3c0a72a5f3d4482ad0947e2

trunk/AUTHORS.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Jesse Ruderman <[email protected]>
2727
Josh Matthews <[email protected]>
2828
Joshua Wise <[email protected]>
2929
Kelly Wilson <[email protected]>
30-
Lennart Kudling
3130
Lindsey Kuper <[email protected]>
3231
Marijn Haverbeke <[email protected]>
3332
Matt Brubeck <[email protected]>

trunk/src/comp/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,7 @@ fn encode_hash(ebml_w: ebml::writer, hash: str) {
653653

654654
fn encode_metadata(cx: @crate_ctxt, crate: @crate) -> str {
655655

656-
let abbrevs = ty::new_ty_hash();
656+
let abbrevs = map::mk_hashmap(ty::hash_ty, ty::eq_ty);
657657
let ecx = @{ccx: cx, type_abbrevs: abbrevs};
658658

659659
let string_w = io::string_writer();

trunk/src/comp/middle/check_const.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ fn check_expr(sess: session, e: @expr, &&is_const: bool, v: visit::vt<bool>) {
4343
"disallowed operator in constant expression");
4444
ret;
4545
}
46+
expr_cast(_, _) { }
4647
expr_lit(@{node: lit_str(_), _}) {
4748
sess.span_err(e.span,
4849
"string constants are not supported");

trunk/src/comp/middle/debuginfo.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ fn create_basic_type(cx: @crate_ctxt, t: ty::t, ty: @ast::ty)
267267
let cache = get_cache(cx);
268268
let tg = BasicTypeDescriptorTag;
269269
alt cached_metadata::<@metadata<tydesc_md>>(
270-
cache, tg, {|md| t == md.data.hash}) {
270+
cache, tg,
271+
{|md| ty::hash_ty(t) == ty::hash_ty(md.data.hash)}) {
271272
option::some(md) { ret md; }
272273
option::none. {}
273274
}
@@ -310,7 +311,7 @@ fn create_basic_type(cx: @crate_ctxt, t: ty::t, ty: @ast::ty)
310311
lli32(0), //XXX flags?
311312
lli32(encoding)];
312313
let llnode = llmdnode(lldata);
313-
let mdval = @{node: llnode, data: {hash: t}};
314+
let mdval = @{node: llnode, data: {hash: ty::hash_ty(t)}};
314315
update_cache(cache, tg, tydesc_metadata(mdval));
315316
add_named_metadata(cx, "llvm.dbg.ty", llnode);
316317
ret mdval;
@@ -332,7 +333,7 @@ fn create_pointer_type(cx: @crate_ctxt, t: ty::t, span: codemap::span,
332333
//let cu_node = create_compile_unit(cx, fname);
333334
let llnode = create_derived_type(tg, file_node.node, "", 0, size * 8,
334335
align * 8, 0, pointee.node);
335-
let mdval = @{node: llnode, data: {hash: t}};
336+
let mdval = @{node: llnode, data: {hash: ty::hash_ty(t)}};
336337
//update_cache(cache, tg, tydesc_metadata(mdval));
337338
add_named_metadata(cx, "llvm.dbg.ty", llnode);
338339
ret mdval;

trunk/src/comp/middle/trans.rs

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3581,7 +3581,12 @@ fn trans_expr(bcx: @block_ctxt, e: @ast::expr, dest: dest) -> @block_ctxt {
35813581
}
35823582
else { ret lval_to_dps(bcx, a, dest); }
35833583
}
3584-
ast::expr_cast(val, _) { ret trans_cast(bcx, val, e.id, dest); }
3584+
ast::expr_cast(val, _) {
3585+
alt tcx.cast_map.find(e.id) {
3586+
some(ty::triv_cast.) { ret trans_expr(bcx, val, dest); }
3587+
_ { ret trans_cast(bcx, val, e.id, dest); }
3588+
}
3589+
}
35853590
ast::expr_anon_obj(anon_obj) {
35863591
ret trans_anon_obj(bcx, e.span, anon_obj, e.id, dest);
35873592
}
@@ -3610,7 +3615,7 @@ fn trans_expr(bcx: @block_ctxt, e: @ast::expr, dest: dest) -> @block_ctxt {
36103615
// that is_call_expr(ex) -- but we don't support that
36113616
// yet
36123617
// FIXME
3613-
check (ast_util::is_call_expr(ex));
3618+
check (ast_util::is_tail_call_expr(ex));
36143619
ret trans_be(bcx, ex);
36153620
}
36163621
ast::expr_fail(expr) {
@@ -3947,7 +3952,8 @@ fn trans_ret(bcx: @block_ctxt, e: option::t<@ast::expr>) -> @block_ctxt {
39473952
fn build_return(bcx: @block_ctxt) { Br(bcx, bcx_fcx(bcx).llreturn); }
39483953

39493954
// fn trans_be(cx: &@block_ctxt, e: &@ast::expr) -> result {
3950-
fn trans_be(cx: @block_ctxt, e: @ast::expr) : ast_util::is_call_expr(e) ->
3955+
fn trans_be(cx: @block_ctxt, e: @ast::expr) :
3956+
ast_util::is_tail_call_expr(e) ->
39513957
@block_ctxt {
39523958
// FIXME: Turn this into a real tail call once
39533959
// calling convention issues are settled
@@ -4348,7 +4354,7 @@ fn new_fn_ctxt_w_id(cx: @local_ctxt, sp: span, llfndecl: ValueRef,
43484354
lllocals: new_int_hash::<local_val>(),
43494355
llupvars: new_int_hash::<ValueRef>(),
43504356
mutable lltydescs: [],
4351-
derived_tydescs: ty::new_ty_hash(),
4357+
derived_tydescs: map::mk_hashmap(ty::hash_ty, ty::eq_ty),
43524358
id: id,
43534359
ret_style: rstyle,
43544360
sp: sp,
@@ -4722,6 +4728,16 @@ fn trans_impl(cx: @local_ctxt, name: ast::ident, methods: [@ast::method],
47224728
// that does so later on?
47234729
fn trans_const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef {
47244730
alt e.node {
4731+
ast::expr_cast(e1, _) {
4732+
alt ccx_tcx(cx).cast_map.find(e.id) {
4733+
some(ty::triv_cast.) { trans_const_expr(cx, e1) }
4734+
_ {
4735+
cx.sess.span_err(e.span,
4736+
"non-trivial cast in constant expression");
4737+
fail;
4738+
}
4739+
}
4740+
}
47254741
ast::expr_lit(lit) { ret trans_crate_lit(cx, *lit); }
47264742
ast::expr_binary(b, e1, e2) {
47274743
let te1 = trans_const_expr(cx, e1);
@@ -5642,6 +5658,13 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
56425658
tn.associate("taskptr", taskptr_type);
56435659
let tydesc_type = T_tydesc(targ_cfg);
56445660
tn.associate("tydesc", tydesc_type);
5661+
let hasher = ty::hash_ty;
5662+
let eqer = ty::eq_ty;
5663+
let tag_sizes = map::mk_hashmap::<ty::t, uint>(hasher, eqer);
5664+
let tydescs = map::mk_hashmap::<ty::t, @tydesc_info>(hasher, eqer);
5665+
let lltypes = map::mk_hashmap::<ty::t, TypeRef>(hasher, eqer);
5666+
let sha1s = map::mk_hashmap::<ty::t, str>(hasher, eqer);
5667+
let short_names = map::mk_hashmap::<ty::t, str>(hasher, eqer);
56455668
let crate_map = decl_crate_map(sess, link_meta.name, llmod);
56465669
let dbg_cx = if sess.get_opts().debuginfo {
56475670
option::some(@{llmetadata: map::new_int_hash(),
@@ -5662,18 +5685,18 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
56625685
item_symbols: new_int_hash::<str>(),
56635686
mutable main_fn: none::<ValueRef>,
56645687
link_meta: link_meta,
5665-
tag_sizes: ty::new_ty_hash(),
5688+
tag_sizes: tag_sizes,
56665689
discrims: ast_util::new_def_id_hash::<ValueRef>(),
56675690
discrim_symbols: new_int_hash::<str>(),
56685691
consts: new_int_hash::<ValueRef>(),
56695692
obj_methods: new_int_hash::<()>(),
5670-
tydescs: ty::new_ty_hash(),
5693+
tydescs: tydescs,
56715694
module_data: new_str_hash::<ValueRef>(),
5672-
lltypes: ty::new_ty_hash(),
5695+
lltypes: lltypes,
56735696
names: namegen(0),
56745697
sha: sha,
5675-
type_sha1s: ty::new_ty_hash(),
5676-
type_short_names: ty::new_ty_hash(),
5698+
type_sha1s: sha1s,
5699+
type_short_names: short_names,
56775700
tcx: tcx,
56785701
mut_map: mut_map,
56795702
copy_map: copy_map,

0 commit comments

Comments
 (0)