The compiler stubs for testing the OSLog implementation are in need of an update. This change updates the stubs to be consistent with the current OSLog implementation, updates the existing tests, and adds new tests for String and metatype interpolations.
rdar://69719729
os log overlay @_transparent so that they will be inlined in their
callers even annotated as @_optimize(none).
Make the OSLogPrototypeCompileTest.swift test suite check only the
output of the OSLogOptimization pass instead of the output of the
Onone pipeline. This will make the tes more resilient to adding
mandatory optimizations later in the pass pipeline. Also, remove
a duplicate test from the OSLogPrototypeExecTest suite.
and instead directly access the array stored in OSLogArguments.
This will make constant folding of the array possible when its
contents are inferred at compile time by the OSLogOptimization pass.
of OSLogMessage constant evaluable and remove @_transparent annotation
from the methods. Also, improve diagnostics in the OSLogOptimization
pass as now it rely on seeing the appendInterpolation/Literal calls.
library so that the type: OSLogByteBufferBuilder is no longer needed.
This would make backward deployment of code using the new log APIs
easier, besides other minor benefits.
@_semantics("constant_evaluable") annotation to denote constant
evaluable functions.
Add a test suite that uses the sil-opt pass ConstantEvaluableSubsetChecker.cpp
to check the constant evaluability of function in the OSLog
overlay.
interpolation of Int types in the new os_log APIs so that it is
easier to extend to other integer types. Based on this, add support
for interpolating Int32 types.
the builtin.globalStringTablePointer to the new OSLog overlay.
Modify the new OSLog implementation to use this SPI instead of
`withCString` to pass the (compiler-generated) format string to
the C os_log_impl ABI.
Move the OSLogOptimization pass before constant propagation in
the pass pipeline so that the SPI and the builtin it uses can be
folded to a string_literal instruction.
Update OSLogTests to work with the changes in the implementation.