@@ -154,8 +154,7 @@ type crate_ctxt =
154
154
task_type : TypeRef ,
155
155
builder : BuilderRef_res ,
156
156
shape_cx : shape:: ctxt ,
157
- gc_cx : gc:: ctxt ,
158
- cstrcache : cstrcache:: t } ;
157
+ gc_cx : gc:: ctxt } ;
159
158
160
159
type local_ctxt =
161
160
{ path: [ str ] ,
@@ -843,11 +842,10 @@ fn C_u8(i: uint) -> ValueRef { ret C_integral(T_i8(), i, False); }
843
842
// This is a 'c-like' raw string, which differs from
844
843
// our boxed-and-length-annotated strings.
845
844
fn C_cstr ( cx : & @crate_ctxt , s : & str ) -> ValueRef {
846
- let sc = llvm:: LLVMConstString ( safe_sbuf ( cx, s) ,
847
- str:: byte_len ( s) , False ) ;
845
+ let sc = llvm:: LLVMConstString ( str:: buf ( s) , str:: byte_len ( s) , False ) ;
848
846
let g =
849
847
llvm:: LLVMAddGlobal ( cx. llmod , val_ty ( sc) ,
850
- safe_sbuf ( cx , cx. names . next ( "str" ) ) ) ;
848
+ str :: buf ( cx. names . next ( "str" ) ) ) ;
851
849
llvm:: LLVMSetInitializer ( g, sc) ;
852
850
llvm:: LLVMSetGlobalConstant ( g, True ) ;
853
851
llvm:: LLVMSetLinkage ( g, lib:: llvm:: LLVMInternalLinkage as llvm:: Linkage ) ;
@@ -865,10 +863,10 @@ fn C_str(cx: &@crate_ctxt, s: &str) -> ValueRef {
865
863
let box =
866
864
C_struct ( [ C_int ( abi:: const_refcount as int ) , C_int ( len + 1 u as int ) ,
867
865
C_int ( len + 1 u as int ) , C_int ( 0 ) ,
868
- llvm:: LLVMConstString ( safe_sbuf ( cx , s) , len, False ) ] ) ;
866
+ llvm:: LLVMConstString ( str :: buf ( s) , len, False ) ] ) ;
869
867
let g =
870
868
llvm:: LLVMAddGlobal ( cx. llmod , val_ty ( box) ,
871
- safe_sbuf ( cx , cx. names . next ( "str" ) ) ) ;
869
+ str :: buf ( cx. names . next ( "str" ) ) ) ;
872
870
llvm:: LLVMSetInitializer ( g, box) ;
873
871
llvm:: LLVMSetGlobalConstant ( g, True ) ;
874
872
llvm:: LLVMSetLinkage ( g, lib:: llvm:: LLVMInternalLinkage as llvm:: Linkage ) ;
@@ -911,18 +909,14 @@ fn C_shape(ccx: &@crate_ctxt, bytes: &[u8]) -> ValueRef {
911
909
let llshape = C_bytes ( bytes) ;
912
910
let llglobal =
913
911
llvm:: LLVMAddGlobal ( ccx. llmod , val_ty ( llshape) ,
914
- safe_sbuf ( ccx , ccx. names . next ( "shape" ) ) ) ;
912
+ str :: buf ( ccx. names . next ( "shape" ) ) ) ;
915
913
llvm:: LLVMSetInitializer ( llglobal, llshape) ;
916
914
llvm:: LLVMSetGlobalConstant ( llglobal, True ) ;
917
915
llvm:: LLVMSetLinkage ( llglobal,
918
916
lib:: llvm:: LLVMInternalLinkage as llvm:: Linkage ) ;
919
917
ret llvm:: LLVMConstPointerCast ( llglobal, T_ptr ( T_i8 ( ) ) ) ;
920
918
}
921
919
922
- fn safe_sbuf ( ccx : & @crate_ctxt , s : & str ) -> str:: rustrt:: sbuf {
923
- cstrcache:: get_cstr ( ccx. cstrcache , s)
924
- }
925
-
926
920
//
927
921
// Local Variables:
928
922
// mode: rust
0 commit comments