about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-09-09 23:55:43 +0000
committerbors <bors@rust-lang.org>2014-09-09 23:55:43 +0000
commita1f49730906ca27947cd99547f7295a1bcf83920 (patch)
tree4894feeb3041bedbce1a7febdf2916e142dcbede /src/rustllvm/RustWrapper.cpp
parent651106462c357b71a4ca2c02ba2bfedfc38b0035 (diff)
parentfcf88b8f87597f97112f048eaa296b3127e51d0b (diff)
downloadrust-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