Logging: make os_log buffer size an integer constant expression.
authorTim Northover <tnorthover@apple.com>
Thu, 1 Nov 2018 13:49:54 +0000 (13:49 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 1 Nov 2018 13:49:54 +0000 (13:49 +0000)
commita94ecc619b3eb82144af0ac049676728b84caa77
tree9fe52dac0071b3a19aeab1f378daa9bcadc1ede2
parent1546efd4a7c1fffe0428ea4f27bf2037eeec4df3
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.

llvm-svn: 345828
clang/lib/AST/ExprConstant.cpp
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/builtins.c