diff options
| author | bors <bors@rust-lang.org> | 2014-09-09 23:55:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-09-09 23:55:43 +0000 |
| commit | a1f49730906ca27947cd99547f7295a1bcf83920 (patch) | |
| tree | 4894feeb3041bedbce1a7febdf2916e142dcbede /src/rustllvm/RustWrapper.cpp | |
| parent | 651106462c357b71a4ca2c02ba2bfedfc38b0035 (diff) | |
| parent | fcf88b8f87597f97112f048eaa296b3127e51d0b (diff) | |
| download | rust-a1f49730906ca27947cd99547f7295a1bcf83920.tar.gz rust-a1f49730906ca27947cd99547f7295a1bcf83920.zip | |
auto merge of #16662 : pczarn/rust/format-fmtstr-opt, r=brson
Based on an observation that strings and arguments are always interleaved, thanks to #15832. Additionally optimize invocations where formatting parameters are unspecified for all arguments, e.g. `"{} {:?} {:x}"`, by emptying the `__STATIC_FMTARGS` array. Next, `Arguments::new` replaces an empty slice with `None` so that passing empty `__STATIC_FMTARGS` generates slightly less machine code when `Arguments::new` is inlined. Furthermore, formatting itself treats these cases separately without making redundant copies of formatting parameters.
All in all, this adds a single mov instruction per `write!` in most cases. That's why code size has increased.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
