Skip to content

Commit e5f4b67

Browse files
committed
---
yaml --- r: 4999 b: refs/heads/master c: f603e91 h: refs/heads/master i: 4997: 2d7d318 4995: 80dec5e 4991: 6bd25f7 v: v3
1 parent 22424c8 commit e5f4b67

File tree

4 files changed

+29
-28
lines changed

4 files changed

+29
-28
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: afe27d461cd78372f5c40f64de6a32a2011d0d9c
2+
refs/heads/master: f603e912ee55c92a40a4b4ea22f20c545b72804f

trunk/src/comp/middle/trans.rs

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3169,7 +3169,7 @@ fn trans_for_each(cx: &@block_ctxt, local: &@ast::local, seq: &@ast::expr,
31693169
// Step 2: Declare foreach body function.
31703170
let s: istr =
31713171
mangle_internal_name_by_path_and_seq(lcx.ccx,
3172-
istr::from_estrs(lcx.path),
3172+
lcx.path,
31733173
~"foreach");
31743174

31753175
// The 'env' arg entering the body function is a fake env member (as in
@@ -3718,7 +3718,7 @@ fn trans_bind_thunk(cx: &@local_ctxt, sp: &span, incoming_fty: ty::t,
37183718
// Give the thunk a name, type, and value.
37193719
let s: istr =
37203720
mangle_internal_name_by_path_and_seq(cx.ccx,
3721-
istr::from_estrs(cx.path),
3721+
cx.path,
37223722
~"thunk");
37233723
let llthunk_ty: TypeRef =
37243724
get_pair_fn_ty(type_of(cx.ccx, sp, incoming_fty));
@@ -4318,9 +4318,9 @@ fn trans_expr_out(cx: &@block_ctxt, e: &@ast::expr, output: out_method) ->
43184318
let llfnty: TypeRef =
43194319
type_of_fn_from_ty(ccx, e.span, node_id_type(ccx, e.id), 0u);
43204320
let sub_cx = extend_path(cx.fcx.lcx,
4321-
istr::to_estr(ccx.names.next(~"anon")));
4321+
ccx.names.next(~"anon"));
43224322
let s = mangle_internal_name_by_path(ccx,
4323-
istr::from_estrs(sub_cx.path));
4323+
sub_cx.path);
43244324
let llfn = decl_internal_fastcall_fn(ccx.llmod,
43254325
istr::to_estr(s), llfnty);
43264326

@@ -4550,15 +4550,15 @@ fn load_if_immediate(cx: &@block_ctxt, v: ValueRef, t: ty::t) -> ValueRef {
45504550

45514551
fn trans_log(lvl: int, cx: &@block_ctxt, e: &@ast::expr) -> result {
45524552
let lcx = cx.fcx.lcx;
4553-
let modname = str::connect(lcx.module_path, "::");
4553+
let modname = istr::connect(lcx.module_path, ~"::");
45544554
let global;
4555-
if lcx.ccx.module_data.contains_key(istr::from_estr(modname)) {
4556-
global = lcx.ccx.module_data.get(istr::from_estr(modname));
4555+
if lcx.ccx.module_data.contains_key(modname) {
4556+
global = lcx.ccx.module_data.get(modname);
45574557
} else {
45584558
let s =
45594559
link::mangle_internal_name_by_path_and_seq(
45604560
lcx.ccx,
4561-
istr::from_estrs(lcx.module_path),
4561+
lcx.module_path,
45624562
~"loglevel");
45634563
global = istr::as_buf(s, { |buf|
45644564
llvm::LLVMAddGlobal(lcx.ccx.llmod, T_int(), buf)
@@ -4567,7 +4567,7 @@ fn trans_log(lvl: int, cx: &@block_ctxt, e: &@ast::expr) -> result {
45674567
llvm::LLVMSetInitializer(global, C_null(T_int()));
45684568
llvm::LLVMSetLinkage(global,
45694569
lib::llvm::LLVMInternalLinkage as llvm::Linkage);
4570-
lcx.ccx.module_data.insert(istr::from_estr(modname), global);
4570+
lcx.ccx.module_data.insert(modname, global);
45714571
}
45724572
let log_cx = new_scope_block_ctxt(cx, "log");
45734573
let after_cx = new_sub_block_ctxt(cx, "after");
@@ -5156,9 +5156,9 @@ fn trans_block(cx: &@block_ctxt, b: &ast::blk, output: &out_method) ->
51565156
}
51575157

51585158
fn new_local_ctxt(ccx: &@crate_ctxt) -> @local_ctxt {
5159-
let pth: [str] = [];
5159+
let pth: [istr] = [];
51605160
ret @{path: pth,
5161-
module_path: [istr::to_estr(ccx.link_meta.name)],
5161+
module_path: [ccx.link_meta.name],
51625162
obj_typarams: [],
51635163
obj_fields: [],
51645164
ccx: ccx};
@@ -5506,7 +5506,8 @@ fn trans_fn(cx: @local_ctxt, sp: &span, f: &ast::_fn, llfndecl: ValueRef,
55065506
let start = time::get_time();
55075507
trans_fn_inner(cx, sp, f, llfndecl, ty_self, ty_params, id);
55085508
let end = time::get_time();
5509-
log_fn_time(cx.ccx, str::connect(cx.path, "::"), start, end);
5509+
log_fn_time(cx.ccx, istr::to_estr(istr::connect(cx.path, ~"::")),
5510+
start, end);
55105511
}
55115512

55125513
fn trans_res_ctor(cx: @local_ctxt, sp: &span, dtor: &ast::_fn,
@@ -5664,7 +5665,7 @@ fn trans_const(cx: &@crate_ctxt, e: @ast::expr, id: ast::node_id) {
56645665
fn trans_item(cx: @local_ctxt, item: &ast::item) {
56655666
alt item.node {
56665667
ast::item_fn(f, tps) {
5667-
let sub_cx = extend_path(cx, istr::to_estr(item.ident));
5668+
let sub_cx = extend_path(cx, item.ident);
56685669
alt cx.ccx.item_ids.find(item.id) {
56695670
some(llfndecl) {
56705671
trans_fn(sub_cx, item.span, f, llfndecl, none, tps, item.id);
@@ -5678,7 +5679,7 @@ fn trans_item(cx: @local_ctxt, item: &ast::item) {
56785679
ast::item_obj(ob, tps, ctor_id) {
56795680
let sub_cx =
56805681
@{obj_typarams: tps, obj_fields: ob.fields
5681-
with *extend_path(cx, istr::to_estr(item.ident))};
5682+
with *extend_path(cx, item.ident)};
56825683
trans_obj(sub_cx, item.span, ob, ctor_id, tps);
56835684
}
56845685
ast::item_res(dtor, dtor_id, tps, ctor_id) {
@@ -5696,13 +5697,13 @@ fn trans_item(cx: @local_ctxt, item: &ast::item) {
56965697
}
56975698
ast::item_mod(m) {
56985699
let sub_cx =
5699-
@{path: cx.path + [istr::to_estr(item.ident)],
5700+
@{path: cx.path + [item.ident],
57005701
module_path: cx.module_path
5701-
+ [istr::to_estr(item.ident)] with *cx};
5702+
+ [item.ident] with *cx};
57025703
trans_mod(sub_cx, m);
57035704
}
57045705
ast::item_tag(variants, tps) {
5705-
let sub_cx = extend_path(cx, istr::to_estr(item.ident));
5706+
let sub_cx = extend_path(cx, item.ident);
57065707
let degen = std::vec::len(variants) == 1u;
57075708
let i = 0;
57085709
for variant: ast::variant in variants {

trunk/src/comp/middle/trans_common.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,8 @@ type crate_ctxt =
160160
gc_cx: gc::ctxt};
161161

162162
type local_ctxt =
163-
{path: [str],
164-
module_path: [str],
163+
{path: [istr],
164+
module_path: [istr],
165165
obj_typarams: [ast::ty_param],
166166
obj_fields: [ast::obj_field],
167167
ccx: @crate_ctxt};
@@ -430,7 +430,7 @@ tag block_parent { parent_none; parent_some(@block_ctxt); }
430430
type result = {bcx: @block_ctxt, val: ValueRef};
431431
type result_t = {bcx: @block_ctxt, val: ValueRef, ty: ty::t};
432432

433-
fn extend_path(cx: @local_ctxt, name: &str) -> @local_ctxt {
433+
fn extend_path(cx: @local_ctxt, name: &istr) -> @local_ctxt {
434434
ret @{path: cx.path + [name] with *cx};
435435
}
436436

trunk/src/comp/middle/trans_objects.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ fn finish_vtbl(cx: @local_ctxt, llmethods: [ValueRef], name: str) ->
570570
ValueRef {
571571
let vtbl = C_struct(llmethods);
572572
let vtbl_name = mangle_internal_name_by_path(
573-
cx.ccx, istr::from_estrs(cx.path + [name]));
573+
cx.ccx, cx.path + [istr::from_estr(name)]);
574574
let gvar = istr::as_buf(vtbl_name, { |buf|
575575
llvm::LLVMAddGlobal(cx.ccx.llmod, val_ty(vtbl), buf)
576576
});
@@ -602,13 +602,13 @@ fn process_bkwding_mthd(cx: @local_ctxt, sp: &span, m: @ty::method,
602602
// Create a local context that's aware of the name of the method we're
603603
// creating.
604604
let mcx: @local_ctxt = @{path: cx.path
605-
+ ["method", istr::to_estr(m.ident)] with *cx};
605+
+ [~"method", m.ident] with *cx};
606606

607607
// Make up a name for the backwarding function.
608608
let fn_name: istr = ~"backwarding_fn";
609609
let s: istr =
610610
mangle_internal_name_by_path_and_seq(
611-
mcx.ccx, istr::from_estrs(mcx.path), fn_name);
611+
mcx.ccx, mcx.path, fn_name);
612612

613613
// Get the backwarding function's type and declare it.
614614
let llbackwarding_fn_ty: TypeRef =
@@ -733,13 +733,13 @@ fn process_fwding_mthd(cx: @local_ctxt, sp: &span, m: @ty::method,
733733
// Create a local context that's aware of the name of the method we're
734734
// creating.
735735
let mcx: @local_ctxt = @{path: cx.path
736-
+ ["method", istr::to_estr(m.ident)] with *cx};
736+
+ [~"method", m.ident] with *cx};
737737

738738
// Make up a name for the forwarding function.
739739
let fn_name: istr = ~"forwarding_fn";
740740
let s: istr =
741741
mangle_internal_name_by_path_and_seq(
742-
mcx.ccx, istr::from_estrs(mcx.path), fn_name);
742+
mcx.ccx, mcx.path, fn_name);
743743

744744
// Get the forwarding function's type and declare it.
745745
let llforwarding_fn_ty: TypeRef =
@@ -926,9 +926,9 @@ fn process_normal_mthd(cx: @local_ctxt, m: @ast::method, self_ty: ty::t,
926926
}
927927
}
928928
let mcx: @local_ctxt =
929-
@{path: cx.path + ["method", istr::to_estr(m.node.ident)] with *cx};
929+
@{path: cx.path + [~"method", m.node.ident] with *cx};
930930
let s: istr = mangle_internal_name_by_path(mcx.ccx,
931-
istr::from_estrs(mcx.path));
931+
mcx.path);
932932
let llfn: ValueRef = decl_internal_fastcall_fn(
933933
cx.ccx.llmod, istr::to_estr(s), llfnty);
934934

0 commit comments

Comments
 (0)