@@ -3169,7 +3169,7 @@ fn trans_for_each(cx: &@block_ctxt, local: &@ast::local, seq: &@ast::expr,
3169
3169
// Step 2: Declare foreach body function.
3170
3170
let s: istr =
3171
3171
mangle_internal_name_by_path_and_seq ( lcx. ccx ,
3172
- istr :: from_estrs ( lcx. path ) ,
3172
+ lcx. path ,
3173
3173
~"foreach") ;
3174
3174
3175
3175
// 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,
3718
3718
// Give the thunk a name, type, and value.
3719
3719
let s: istr =
3720
3720
mangle_internal_name_by_path_and_seq ( cx. ccx ,
3721
- istr :: from_estrs ( cx. path ) ,
3721
+ cx. path ,
3722
3722
~"thunk") ;
3723
3723
let llthunk_ty: TypeRef =
3724
3724
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) ->
4318
4318
let llfnty: TypeRef =
4319
4319
type_of_fn_from_ty ( ccx, e. span , node_id_type ( ccx, e. id ) , 0 u) ;
4320
4320
let sub_cx = extend_path ( cx. fcx . lcx ,
4321
- istr :: to_estr ( ccx. names . next ( ~"anon") ) ) ;
4321
+ ccx. names . next ( ~"anon") ) ;
4322
4322
let s = mangle_internal_name_by_path ( ccx,
4323
- istr :: from_estrs ( sub_cx. path ) ) ;
4323
+ sub_cx. path ) ;
4324
4324
let llfn = decl_internal_fastcall_fn ( ccx. llmod ,
4325
4325
istr:: to_estr ( s) , llfnty) ;
4326
4326
@@ -4550,15 +4550,15 @@ fn load_if_immediate(cx: &@block_ctxt, v: ValueRef, t: ty::t) -> ValueRef {
4550
4550
4551
4551
fn trans_log ( lvl : int , cx : & @block_ctxt , e : & @ast:: expr ) -> result {
4552
4552
let lcx = cx. fcx . lcx ;
4553
- let modname = str :: connect ( lcx. module_path , "::" ) ;
4553
+ let modname = istr :: connect ( lcx. module_path , ~ ":: ") ;
4554
4554
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) ;
4557
4557
} else {
4558
4558
let s =
4559
4559
link:: mangle_internal_name_by_path_and_seq (
4560
4560
lcx. ccx ,
4561
- istr :: from_estrs ( lcx. module_path ) ,
4561
+ lcx. module_path ,
4562
4562
~"loglevel") ;
4563
4563
global = istr:: as_buf ( s, { |buf|
4564
4564
llvm:: LLVMAddGlobal ( lcx. ccx . llmod , T_int ( ) , buf)
@@ -4567,7 +4567,7 @@ fn trans_log(lvl: int, cx: &@block_ctxt, e: &@ast::expr) -> result {
4567
4567
llvm:: LLVMSetInitializer ( global, C_null ( T_int ( ) ) ) ;
4568
4568
llvm:: LLVMSetLinkage ( global,
4569
4569
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) ;
4571
4571
}
4572
4572
let log_cx = new_scope_block_ctxt ( cx, "log" ) ;
4573
4573
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) ->
5156
5156
}
5157
5157
5158
5158
fn new_local_ctxt ( ccx : & @crate_ctxt ) -> @local_ctxt {
5159
- let pth: [ str ] = [ ] ;
5159
+ let pth: [ istr ] = [ ] ;
5160
5160
ret @{ path : pth,
5161
- module_path : [ istr :: to_estr ( ccx. link_meta . name ) ] ,
5161
+ module_path : [ ccx. link_meta . name ] ,
5162
5162
obj_typarams : [ ] ,
5163
5163
obj_fields : [ ] ,
5164
5164
ccx : ccx} ;
@@ -5506,7 +5506,8 @@ fn trans_fn(cx: @local_ctxt, sp: &span, f: &ast::_fn, llfndecl: ValueRef,
5506
5506
let start = time::get_time();
5507
5507
trans_fn_inner(cx, sp, f, llfndecl, ty_self, ty_params, id);
5508
5508
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) ;
5510
5511
}
5511
5512
5512
5513
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) {
5664
5665
fn trans_item ( cx : @local_ctxt , item : & ast:: item ) {
5665
5666
alt item. node {
5666
5667
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 ) ;
5668
5669
alt cx. ccx . item_ids . find ( item. id ) {
5669
5670
some ( llfndecl) {
5670
5671
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) {
5678
5679
ast:: item_obj ( ob, tps, ctor_id) {
5679
5680
let sub_cx =
5680
5681
@{ obj_typarams: tps, obj_fields: ob. fields
5681
- with * extend_path ( cx, istr :: to_estr ( item. ident ) ) } ;
5682
+ with * extend_path ( cx, item. ident ) } ;
5682
5683
trans_obj ( sub_cx, item. span , ob, ctor_id, tps) ;
5683
5684
}
5684
5685
ast:: item_res ( dtor, dtor_id, tps, ctor_id) {
@@ -5696,13 +5697,13 @@ fn trans_item(cx: @local_ctxt, item: &ast::item) {
5696
5697
}
5697
5698
ast:: item_mod ( m) {
5698
5699
let sub_cx =
5699
- @{ path: cx. path + [ istr :: to_estr ( item. ident ) ] ,
5700
+ @{ path: cx. path + [ item. ident ] ,
5700
5701
module_path: cx. module_path
5701
- + [ istr :: to_estr ( item. ident ) ] with * cx} ;
5702
+ + [ item. ident ] with * cx} ;
5702
5703
trans_mod ( sub_cx, m) ;
5703
5704
}
5704
5705
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 ) ;
5706
5707
let degen = std:: vec:: len ( variants) == 1 u;
5707
5708
let i = 0 ;
5708
5709
for variant: ast:: variant in variants {
0 commit comments