@@ -64,6 +64,7 @@ use core::sys;
64
64
use core:: vec;
65
65
use syntax:: codemap:: span;
66
66
use syntax:: { ast, codemap, ast_util, ast_map} ;
67
+ use syntax:: parse:: token;
67
68
68
69
static DW_LANG_RUST : int = 0x9000 ;
69
70
@@ -86,7 +87,6 @@ static DW_ATE_unsigned_char: int = 0x08;
86
87
87
88
/// A context object for maintaining all state needed by the debuginfo module.
88
89
pub struct DebugContext {
89
- names : namegen ,
90
90
crate_file : ~str ,
91
91
llcontext : ContextRef ,
92
92
builder : DIBuilderRef ,
@@ -104,7 +104,6 @@ impl DebugContext {
104
104
// DIBuilder inherits context from the module, so we'd better use the same one
105
105
let llcontext = unsafe { llvm:: LLVMGetModuleContext ( llmod) } ;
106
106
return DebugContext {
107
- names : new_namegen ( ) ,
108
107
crate_file: crate ,
109
108
llcontext : llcontext,
110
109
builder : builder,
@@ -276,7 +275,8 @@ pub fn create_function(fcx: fn_ctxt) -> DISubprogram {
276
275
ast_map:: node_expr( expr) => {
277
276
match expr. node {
278
277
ast:: expr_fn_block( ref decl, _) => {
279
- ( ( dbg_cx ( cx) . names ) ( "fn" ) , decl. output , expr. id )
278
+ let name = gensym_name ( "fn" ) ;
279
+ ( name, decl. output , expr. id )
280
280
}
281
281
_ => fcx. ccx . sess . span_bug ( expr. span ,
282
282
"create_function: expected an expr_fn_block here" )
@@ -628,7 +628,7 @@ fn create_tuple(cx: &mut CrateContext, tuple_type: ty::t, elements: &[ty::t], sp
628
628
let loc = span_start ( cx, span) ;
629
629
let file_md = create_file ( cx, loc. file . name ) ;
630
630
631
- let name = ( cx . sess . str_of ( ( dbg_cx ( cx ) . names ) ( "tuple" ) ) ) . to_owned ( ) ;
631
+ let name = fmt ! ( "tuple_%u" , token :: gensym ( "tuple" ) ) ;
632
632
let mut scx = StructContext :: new ( cx, name, file_md, loc. line ) ;
633
633
for elements. iter( ) . advance |element| {
634
634
let ty_md = create_ty( cx, * element, span) ;
@@ -911,8 +911,6 @@ fn set_debug_location(cx: @mut CrateContext, scope: DIScope, line: uint, col: ui
911
911
}
912
912
913
913
914
-
915
-
916
914
//=-------------------------------------------------------------------------------------------------
917
915
// Utility Functions
918
916
//=-------------------------------------------------------------------------------------------------
0 commit comments