@@ -319,17 +319,6 @@ impl Context {
319
319
}
320
320
}
321
321
322
- /// These attributes are applied to all statics that this syntax extension
323
- /// will generate.
324
- fn static_attrs ( & self ) -> ~[ ast:: Attribute ] {
325
- // Flag statics as `address_insignificant` so LLVM can merge duplicate
326
- // globals as much as possible (which we're generating a whole lot of).
327
- let unnamed = self . ecx . meta_word ( self . fmtsp , @"address_insignificant") ;
328
- let unnamed = self . ecx . attribute ( self . fmtsp , unnamed) ;
329
-
330
- return ~[ unnamed] ;
331
- }
332
-
333
322
/// Translate a `parse::Piece` to a static `rt::Piece`
334
323
fn trans_piece ( & mut self , piece : & parse:: Piece ) -> @ast:: Expr {
335
324
let sp = self . fmtsp ;
@@ -455,9 +444,14 @@ impl Context {
455
444
~[ ]
456
445
) , None ) ;
457
446
let st = ast:: item_static ( ty, ast:: MutImmutable , method) ;
458
- let static_name = self . ecx . ident_of ( format ! ( "__STATIC_METHOD_ {}" ,
447
+ let static_name = self . ecx . ident_of ( format ! ( "__static_method_ {}" ,
459
448
self . method_statics. len( ) ) ) ;
460
- let item = self . ecx . item ( sp, static_name, self . static_attrs ( ) , st) ;
449
+ // Flag these statics as `address_insignificant` so LLVM can
450
+ // merge duplicate globals as much as possible (which we're
451
+ // generating a whole lot of).
452
+ let unnamed = self . ecx . meta_word ( self . fmtsp , @"address_insignificant") ;
453
+ let unnamed = self . ecx . attribute ( self . fmtsp , unnamed) ;
454
+ let item = self . ecx . item ( sp, static_name, ~[ unnamed] , st) ;
461
455
self . method_statics . push ( item) ;
462
456
self . ecx . expr_ident ( sp, static_name)
463
457
} ;
@@ -578,9 +572,11 @@ impl Context {
578
572
) ;
579
573
let ty = self . ecx . ty ( self . fmtsp , ty) ;
580
574
let st = ast:: item_static ( ty, ast:: MutImmutable , fmt) ;
581
- let static_name = self . ecx . ident_of ( "__STATIC_FMTSTR" ) ;
582
- let item = self . ecx . item ( self . fmtsp , static_name,
583
- self . static_attrs ( ) , st) ;
575
+ let static_name = self . ecx . ident_of ( "__static_fmtstr" ) ;
576
+ // see above comment for `address_insignificant` and why we do it
577
+ let unnamed = self . ecx . meta_word ( self . fmtsp , @"address_insignificant") ;
578
+ let unnamed = self . ecx . attribute ( self . fmtsp , unnamed) ;
579
+ let item = self . ecx . item ( self . fmtsp , static_name, ~[ unnamed] , st) ;
584
580
let decl = respan ( self . fmtsp , ast:: DeclItem ( item) ) ;
585
581
lets. push ( @respan ( self . fmtsp , ast:: StmtDecl ( @decl, ast:: DUMMY_NODE_ID ) ) ) ;
586
582
0 commit comments