[PATCH] D25888: Add support for __builtin_os_log_format[_buffer_size]

Mehdi AMINI via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 21 16:48:47 PDT 2016


mehdi_amini created this revision.
mehdi_amini added a reviewer: bkramer.
mehdi_amini added a subscriber: cfe-commits.
Herald added subscribers: modocache, mgorny, beanz.

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.


https://reviews.llvm.org/D25888

Files:
  clang/include/clang/Analysis/Analyses/FormatString.h
  clang/include/clang/Analysis/Analyses/OSLog.h
  clang/include/clang/Basic/Builtins.def
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/include/clang/Sema/Sema.h
  clang/lib/Analysis/CMakeLists.txt
  clang/lib/Analysis/FormatString.cpp
  clang/lib/Analysis/OSLog.cpp
  clang/lib/Analysis/PrintfFormatString.cpp
  clang/lib/CodeGen/CGBuiltin.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/lib/Sema/SemaDeclAttr.cpp
  clang/test/CodeGen/builtins.c
  clang/test/CodeGenObjC/os_log.m
  clang/test/SemaObjC/format-strings-oslog.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25888.75512.patch
Type: text/x-patch
Size: 58921 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161021/f65a53bc/attachment-0001.bin>


More information about the cfe-commits mailing list