Skip to content

Commit 47d27af

Browse files
committed
Merge branch 'master' of github.com:graydon/rust
2 parents 8005f0c + 07d7f82 commit 47d27af

File tree

16 files changed

+176
-322
lines changed

16 files changed

+176
-322
lines changed

AUTHORS.txt

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ Jesse Ruderman <[email protected]>
2727
Josh Matthews <[email protected]>
2828
Joshua Wise <[email protected]>
2929
Kelly Wilson <[email protected]>
30+
Lennart Kudling
3031
Lindsey Kuper <[email protected]>
3132
Marijn Haverbeke <[email protected]>
3233
Matt Brubeck <[email protected]>

src/comp/metadata/encoder.rs

+1-1
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 = map::mk_hashmap(ty::hash_ty, ty::eq_ty);
656+
let abbrevs = ty::new_ty_hash();
657657
let ecx = @{ccx: cx, type_abbrevs: abbrevs};
658658

659659
let string_w = io::string_writer();

src/comp/middle/check_const.rs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ 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(_, _) { }
4746
expr_lit(@{node: lit_str(_), _}) {
4847
sess.span_err(e.span,
4948
"string constants are not supported");

src/comp/middle/debuginfo.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ 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,
271-
{|md| ty::hash_ty(t) == ty::hash_ty(md.data.hash)}) {
270+
cache, tg, {|md| t == md.data.hash}) {
272271
option::some(md) { ret md; }
273272
option::none. {}
274273
}
@@ -311,7 +310,7 @@ fn create_basic_type(cx: @crate_ctxt, t: ty::t, ty: @ast::ty)
311310
lli32(0), //XXX flags?
312311
lli32(encoding)];
313312
let llnode = llmdnode(lldata);
314-
let mdval = @{node: llnode, data: {hash: ty::hash_ty(t)}};
313+
let mdval = @{node: llnode, data: {hash: t}};
315314
update_cache(cache, tg, tydesc_metadata(mdval));
316315
add_named_metadata(cx, "llvm.dbg.ty", llnode);
317316
ret mdval;
@@ -333,7 +332,7 @@ fn create_pointer_type(cx: @crate_ctxt, t: ty::t, span: codemap::span,
333332
//let cu_node = create_compile_unit(cx, fname);
334333
let llnode = create_derived_type(tg, file_node.node, "", 0, size * 8,
335334
align * 8, 0, pointee.node);
336-
let mdval = @{node: llnode, data: {hash: ty::hash_ty(t)}};
335+
let mdval = @{node: llnode, data: {hash: t}};
337336
//update_cache(cache, tg, tydesc_metadata(mdval));
338337
add_named_metadata(cx, "llvm.dbg.ty", llnode);
339338
ret mdval;

src/comp/middle/trans.rs

+9-32
Original file line numberDiff line numberDiff line change
@@ -3581,12 +3581,7 @@ 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, _) {
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-
}
3584+
ast::expr_cast(val, _) { ret trans_cast(bcx, val, e.id, dest); }
35903585
ast::expr_anon_obj(anon_obj) {
35913586
ret trans_anon_obj(bcx, e.span, anon_obj, e.id, dest);
35923587
}
@@ -3615,7 +3610,7 @@ fn trans_expr(bcx: @block_ctxt, e: @ast::expr, dest: dest) -> @block_ctxt {
36153610
// that is_call_expr(ex) -- but we don't support that
36163611
// yet
36173612
// FIXME
3618-
check (ast_util::is_tail_call_expr(ex));
3613+
check (ast_util::is_call_expr(ex));
36193614
ret trans_be(bcx, ex);
36203615
}
36213616
ast::expr_fail(expr) {
@@ -3952,8 +3947,7 @@ fn trans_ret(bcx: @block_ctxt, e: option::t<@ast::expr>) -> @block_ctxt {
39523947
fn build_return(bcx: @block_ctxt) { Br(bcx, bcx_fcx(bcx).llreturn); }
39533948

39543949
// fn trans_be(cx: &@block_ctxt, e: &@ast::expr) -> result {
3955-
fn trans_be(cx: @block_ctxt, e: @ast::expr) :
3956-
ast_util::is_tail_call_expr(e) ->
3950+
fn trans_be(cx: @block_ctxt, e: @ast::expr) : ast_util::is_call_expr(e) ->
39573951
@block_ctxt {
39583952
// FIXME: Turn this into a real tail call once
39593953
// calling convention issues are settled
@@ -4354,7 +4348,7 @@ fn new_fn_ctxt_w_id(cx: @local_ctxt, sp: span, llfndecl: ValueRef,
43544348
lllocals: new_int_hash::<local_val>(),
43554349
llupvars: new_int_hash::<ValueRef>(),
43564350
mutable lltydescs: [],
4357-
derived_tydescs: map::mk_hashmap(ty::hash_ty, ty::eq_ty),
4351+
derived_tydescs: ty::new_ty_hash(),
43584352
id: id,
43594353
ret_style: rstyle,
43604354
sp: sp,
@@ -4728,16 +4722,6 @@ fn trans_impl(cx: @local_ctxt, name: ast::ident, methods: [@ast::method],
47284722
// that does so later on?
47294723
fn trans_const_expr(cx: @crate_ctxt, e: @ast::expr) -> ValueRef {
47304724
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-
}
47414725
ast::expr_lit(lit) { ret trans_crate_lit(cx, *lit); }
47424726
ast::expr_binary(b, e1, e2) {
47434727
let te1 = trans_const_expr(cx, e1);
@@ -5658,13 +5642,6 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
56585642
tn.associate("taskptr", taskptr_type);
56595643
let tydesc_type = T_tydesc(targ_cfg);
56605644
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);
56685645
let crate_map = decl_crate_map(sess, link_meta.name, llmod);
56695646
let dbg_cx = if sess.get_opts().debuginfo {
56705647
option::some(@{llmetadata: map::new_int_hash(),
@@ -5685,18 +5662,18 @@ fn trans_crate(sess: session::session, crate: @ast::crate, tcx: ty::ctxt,
56855662
item_symbols: new_int_hash::<str>(),
56865663
mutable main_fn: none::<ValueRef>,
56875664
link_meta: link_meta,
5688-
tag_sizes: tag_sizes,
5665+
tag_sizes: ty::new_ty_hash(),
56895666
discrims: ast_util::new_def_id_hash::<ValueRef>(),
56905667
discrim_symbols: new_int_hash::<str>(),
56915668
consts: new_int_hash::<ValueRef>(),
56925669
obj_methods: new_int_hash::<()>(),
5693-
tydescs: tydescs,
5670+
tydescs: ty::new_ty_hash(),
56945671
module_data: new_str_hash::<ValueRef>(),
5695-
lltypes: lltypes,
5672+
lltypes: ty::new_ty_hash(),
56965673
names: namegen(0),
56975674
sha: sha,
5698-
type_sha1s: sha1s,
5699-
type_short_names: short_names,
5675+
type_sha1s: ty::new_ty_hash(),
5676+
type_short_names: ty::new_ty_hash(),
57005677
tcx: tcx,
57015678
mut_map: mut_map,
57025679
copy_map: copy_map,

0 commit comments

Comments
 (0)