[llvm-commits] [commit-after-approval] printf("foo %s baz\n", "bar") -> puts("foo bar baz")

Ryan Flynn parseerror at gmail.com
Mon Aug 3 10:48:04 PDT 2009


given a printf() call format containing a single "%s" conversion
specifier and a constant string parameter, inlines parameter into
format and lowers printf() to puts().

it's a bit more complex than the other printf() optimizations, but i
happened to run into the situation and it seemed pretty common and
straightforward to implement.

my first attempt at an optimization, constructive criticism appreciated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: printf-inline-string-param.patch
Type: text/x-diff
Size: 2478 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20090803/b8beb86d/attachment.patch>


More information about the llvm-commits mailing list