diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-24 16:56:23 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-24 16:56:23 +0000 |
commit | 29034362ae872dfc46fd994893d2def8f32d7a18 (patch) | |
tree | f0df5c91d2e55149043d5cc4edbdee2a1e3090a9 /clang/lib/Analysis/FormatString.cpp | |
parent | b05bac940da334e10dee66f4d1d88c53014bcf5d (diff) | |
download | llvm-29034362ae872dfc46fd994893d2def8f32d7a18.zip llvm-29034362ae872dfc46fd994893d2def8f32d7a18.tar.gz llvm-29034362ae872dfc46fd994893d2def8f32d7a18.tar.bz2 |
Add support for __builtin_os_log_format[_buffer_size]
These new builtins support a mechanism for logging OS events, using a
printf-like format string to specify the layout of data in a buffer.
The _buffer_size version of the builtin can be used to determine the size
of the buffer to allocate to hold the data, and then __builtin_os_log_format
can write data into that buffer. This implements format checking to report
mismatches between the format string and the data arguments. Most of this
code was written by Chris Willmore.
Differential Revision: https://reviews.llvm.org/D25888
llvm-svn: 284990
Diffstat (limited to 'clang/lib/Analysis/FormatString.cpp')
-rw-r--r-- | clang/lib/Analysis/FormatString.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Analysis/FormatString.cpp b/clang/lib/Analysis/FormatString.cpp index 2a518ca..c62e537 100644 --- a/clang/lib/Analysis/FormatString.cpp +++ b/clang/lib/Analysis/FormatString.cpp @@ -591,6 +591,8 @@ const char *ConversionSpecifier::toString() const { case cArg: return "c"; case sArg: return "s"; case pArg: return "p"; + case PArg: + return "P"; case nArg: return "n"; case PercentArg: return "%"; case ScanListArg: return "["; @@ -866,6 +868,7 @@ bool FormatSpecifier::hasStandardConversionSpecifier( case ConversionSpecifier::ObjCObjArg: case ConversionSpecifier::ScanListArg: case ConversionSpecifier::PercentArg: + case ConversionSpecifier::PArg: return true; case ConversionSpecifier::CArg: case ConversionSpecifier::SArg: |