diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2017-10-06 07:12:46 +0000 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2017-10-06 07:12:46 +0000 |
commit | 6b103bc18c4069098f59394cc6b39a645c1bfe1e (patch) | |
tree | be77044162e4a8e0de096ba4ec13458981f553cc /clang/lib/CodeGen/CodeGenModule.h | |
parent | bcd36f7c5a1187169b0c804dcb86eb4a7655be0f (diff) | |
download | bcm5719-llvm-6b103bc18c4069098f59394cc6b39a645c1bfe1e.tar.gz bcm5719-llvm-6b103bc18c4069098f59394cc6b39a645c1bfe1e.zip |
[CodeGen] Emit a helper function for __builtin_os_log_format to reduce
code size.
Currently clang expands a call to __builtin_os_log_format into a long
sequence of instructions at the call site, causing code size to
increase in some cases.
This commit attempts to reduce code size by emitting a helper function
that can be shared by calls to __builtin_os_log_format with similar
formats and arguments. The helper function has linkonce_odr linkage to
enable the linker to merge identical functions across translation units.
Attribute 'noinline' is attached to the helper function at -Oz so that
the inliner doesn't inline functions that can potentially be merged.
This commit also fixes a bug where the generated IR writes past the end
of the buffer when "%m" is the last specifier appearing in the format
string passed to __builtin_os_log_format.
Original patch by Duncan Exon Smith.
rdar://problem/34065973
rdar://problem/34196543
Differential Revision: https://reviews.llvm.org/D38606
llvm-svn: 315045
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
0 files changed, 0 insertions, 0 deletions