Reapply Logging: make os_log buffer size an integer constant expression.
authorTim Northover <tnorthover@apple.com>
Fri, 2 Nov 2018 13:14:11 +0000 (13:14 +0000)
committerTim Northover <tnorthover@apple.com>
Fri, 2 Nov 2018 13:14:11 +0000 (13:14 +0000)
commit314fbfa1c4c6665c54a220eefb10a6f23010a352
treee7249debf2e3c4d030fd1be7460a7f72a30a1c19
parentc55d09a00e8067f27de2bb88c12a2bee64a2192a
Reapply Logging: make os_log buffer size an integer constant expression.

The size of an os_log buffer is known at any stage of compilation, so making it
a constant expression means that the common idiom of declaring a buffer for it
won't result in a VLA. That allows the compiler to skip saving and restoring
the stack pointer around such buffers.

This also moves the OSLog and other FormatString helpers from
libclangAnalysis to libclangAST to avoid a circular dependency.

llvm-svn: 345971
15 files changed:
clang-tools-extra/clang-tidy/cert/CMakeLists.txt
clang-tools-extra/clang-tidy/cert/StrToNumCheck.cpp
clang/include/clang/AST/FormatString.h [moved from clang/include/clang/Analysis/Analyses/FormatString.h with 100% similarity]
clang/include/clang/AST/OSLog.h [moved from clang/include/clang/Analysis/Analyses/OSLog.h with 100% similarity]
clang/lib/AST/CMakeLists.txt
clang/lib/AST/ExprConstant.cpp
clang/lib/AST/FormatString.cpp [moved from clang/lib/Analysis/FormatString.cpp with 100% similarity]
clang/lib/AST/FormatStringParsing.h [moved from clang/lib/Analysis/FormatStringParsing.h with 98% similarity]
clang/lib/AST/OSLog.cpp [moved from clang/lib/Analysis/OSLog.cpp with 98% similarity]
clang/lib/AST/PrintfFormatString.cpp [moved from clang/lib/Analysis/PrintfFormatString.cpp with 99% similarity]
clang/lib/AST/ScanfFormatString.cpp [moved from clang/lib/Analysis/ScanfFormatString.cpp with 99% similarity]
clang/lib/Analysis/CMakeLists.txt
clang/lib/CodeGen/CGBuiltin.cpp
clang/lib/Sema/SemaChecking.cpp
clang/test/CodeGen/builtins.c