diff options
| author | bors <bors@rust-lang.org> | 2014-07-22 09:01:17 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-07-22 09:01:17 +0000 |
| commit | 62f1bb047bdbb02b08e4e50a9716af2da6799241 (patch) | |
| tree | 55885791d66ad7bc6f4bfeb0b61631ef5be15406 /src/libsyntax/ext | |
| parent | 8d43e4474aba98d99e2778dcdcd5b0515b7b8176 (diff) | |
| parent | 1654f08e030a59c6438347cd822a82a3da0abbc7 (diff) | |
| download | rust-62f1bb047bdbb02b08e4e50a9716af2da6799241.tar.gz rust-62f1bb047bdbb02b08e4e50a9716af2da6799241.zip | |
auto merge of #15871 : dotdash/rust/unnamed_fmtstr, r=pcwalton
Diffstat (limited to 'src/libsyntax/ext')
| -rw-r--r-- | src/libsyntax/ext/format.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsyntax/ext/format.rs b/src/libsyntax/ext/format.rs index 2e86d1c005d..b00924c1590 100644 --- a/src/libsyntax/ext/format.rs +++ b/src/libsyntax/ext/format.rs @@ -319,6 +319,11 @@ impl<'a, 'b> Context<'a, 'b> { /// These attributes are applied to all statics that this syntax extension /// will generate. fn static_attrs(&self) -> Vec<ast::Attribute> { + // Flag statics as `inline` so LLVM can merge duplicate globals as much + // as possible (which we're generating a whole lot of). + let unnamed = self.ecx.meta_word(self.fmtsp, InternedString::new("inline")); + let unnamed = self.ecx.attribute(self.fmtsp, unnamed); + // Do not warn format string as dead code let dead_code = self.ecx.meta_word(self.fmtsp, InternedString::new("dead_code")); @@ -326,7 +331,7 @@ impl<'a, 'b> Context<'a, 'b> { InternedString::new("allow"), vec!(dead_code)); let allow_dead_code = self.ecx.attribute(self.fmtsp, allow_dead_code); - return vec!(allow_dead_code); + return vec!(unnamed, allow_dead_code); } fn rtpath(&self, s: &str) -> Vec<ast::Ident> { |
