@@ -843,9 +843,10 @@ fn C_u8(i: uint) -> ValueRef { ret C_integral(T_i8(), i, False); }
843
843
// our boxed-and-length-annotated strings.
844
844
fn C_cstr ( cx : & @crate_ctxt , s : & str ) -> ValueRef {
845
845
let sc = llvm:: LLVMConstString ( str:: buf ( s) , str:: byte_len ( s) , False ) ;
846
+ let gname = cx. names . next ( "str" ) ;
846
847
let g =
847
848
llvm:: LLVMAddGlobal ( cx. llmod , val_ty ( sc) ,
848
- str:: buf ( cx . names . next ( "str" ) ) ) ;
849
+ str:: buf ( gname ) ) ;
849
850
llvm:: LLVMSetInitializer ( g, sc) ;
850
851
llvm:: LLVMSetGlobalConstant ( g, True ) ;
851
852
llvm:: LLVMSetLinkage ( g, lib:: llvm:: LLVMInternalLinkage as llvm:: Linkage ) ;
@@ -864,9 +865,9 @@ fn C_str(cx: &@crate_ctxt, s: &str) -> ValueRef {
864
865
C_struct ( [ C_int ( abi:: const_refcount as int ) , C_int ( len + 1 u as int ) ,
865
866
C_int ( len + 1 u as int ) , C_int ( 0 ) ,
866
867
llvm:: LLVMConstString ( str:: buf ( s) , len, False ) ] ) ;
868
+ let gname = cx. names . next ( "str" ) ;
867
869
let g =
868
- llvm:: LLVMAddGlobal ( cx. llmod , val_ty ( box) ,
869
- str:: buf ( cx. names . next ( "str" ) ) ) ;
870
+ llvm:: LLVMAddGlobal ( cx. llmod , val_ty ( box) , str:: buf ( gname) ) ;
870
871
llvm:: LLVMSetInitializer ( g, box) ;
871
872
llvm:: LLVMSetGlobalConstant ( g, True ) ;
872
873
llvm:: LLVMSetLinkage ( g, lib:: llvm:: LLVMInternalLinkage as llvm:: Linkage ) ;
@@ -907,9 +908,9 @@ fn C_bytes(bytes: &[u8]) -> ValueRef {
907
908
908
909
fn C_shape ( ccx : & @crate_ctxt , bytes : & [ u8 ] ) -> ValueRef {
909
910
let llshape = C_bytes ( bytes) ;
911
+ let gname = ccx. names . next ( "shape" ) ;
910
912
let llglobal =
911
- llvm:: LLVMAddGlobal ( ccx. llmod , val_ty ( llshape) ,
912
- str:: buf ( ccx. names . next ( "shape" ) ) ) ;
913
+ llvm:: LLVMAddGlobal ( ccx. llmod , val_ty ( llshape) , str:: buf ( gname) ) ;
913
914
llvm:: LLVMSetInitializer ( llglobal, llshape) ;
914
915
llvm:: LLVMSetGlobalConstant ( llglobal, True ) ;
915
916
llvm:: LLVMSetLinkage ( llglobal,
0 commit comments