@@ -64,6 +64,7 @@ use core::sys;
6464use core:: vec;
6565use syntax:: codemap:: span;
6666use syntax:: { ast, codemap, ast_util, ast_map} ;
67+ use syntax:: parse:: token;
6768
6869static DW_LANG_RUST : int = 0x9000 ;
6970
@@ -86,7 +87,6 @@ static DW_ATE_unsigned_char: int = 0x08;
8687
8788/// A context object for maintaining all state needed by the debuginfo module.
8889pub struct DebugContext {
89- names : namegen ,
9090 crate_file : ~str ,
9191 llcontext : ContextRef ,
9292 builder : DIBuilderRef ,
@@ -104,7 +104,6 @@ impl DebugContext {
104104 // DIBuilder inherits context from the module, so we'd better use the same one
105105 let llcontext = unsafe { llvm:: LLVMGetModuleContext ( llmod) } ;
106106 return DebugContext {
107- names : new_namegen ( ) ,
108107 crate_file: crate ,
109108 llcontext : llcontext,
110109 builder : builder,
@@ -276,7 +275,8 @@ pub fn create_function(fcx: fn_ctxt) -> DISubprogram {
276275 ast_map:: node_expr( expr) => {
277276 match expr. node {
278277 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 )
280280 }
281281 _ => fcx. ccx . sess . span_bug ( expr. span ,
282282 "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
628628 let loc = span_start ( cx, span) ;
629629 let file_md = create_file ( cx, loc. file . name ) ;
630630
631- let name = ( cx . sess . str_of ( ( dbg_cx ( cx ) . names ) ( "tuple" ) ) ) . to_owned ( ) ;
631+ let name = fmt ! ( "tuple_%u" , token :: gensym ( "tuple" ) ) ;
632632 let mut scx = StructContext :: new ( cx, name, file_md, loc. line ) ;
633633 for elements. iter( ) . advance |element| {
634634 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
911911}
912912
913913
914-
915-
916914//=-------------------------------------------------------------------------------------------------
917915// Utility Functions
918916//=-------------------------------------------------------------------------------------------------
0 commit comments