Commit Graph

18 Commits

Author SHA1 Message Date
Josh Learn
1fd6ef95ce [OSLog] Update compiler stubs and tests
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
2020-10-01 12:14:08 -07:00
Ravi Kandhadai
b57a1d7c0e [Sema] Add miscellaneous sema diagnostics to check that the new os log
APIs and atomic operations are passed compile-time constants for
certain arguments.
2020-04-06 18:41:13 -07:00
Ravi Kandhadai
3c7f6d88e2 [stdlib/private][OSLog] Add basic support for interpolating floating-point
types without formatting options, add an auto-inferred privacy mode and
make it the default privacy mode, add support for aligning string
arguments.
2020-02-12 18:46:50 -08:00
Ravi Kandhadai
4f2a55bdd4 [stdlib/private][OSLog] Support expressive, fprintf-style formatting
options for integers passed to os log string interpolation.
2020-02-07 17:36:06 -08:00
Ravi Kandhadai
e631c66e0d [stdlib/private][os log] Annotate tiny helper functions in the new
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.
2020-02-04 11:03:38 -08:00
Ravi Kandhadai
05be088431 [stdlib/private][oslog] Make tiny helper functions of struct OSLogMessage constant_evaluable
instead of transparent.
2019-12-03 11:14:49 -08:00
Ravi Kandhadai
b0de132aad [stdlib-private][oslog] Remove OSLogArguments.serializeAt method
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.
2019-11-07 17:11:07 -08:00
Ravi Kandhadai
861c0aaca9 [OSLogOptimization][stdlib/private] Make string interpolation methods
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.
2019-10-29 19:35:37 -07:00
Ravi Kandhadai
7dabec4db2 [oslog][stdlib-private] Modify the implementation of the new OSLog
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.
2019-09-25 17:47:27 -07:00
Ravi Kandhadai
61fd4b1431 [OSLog][Test] Update the new oslog overlay implementation to use
@_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.
2019-09-18 10:44:48 -07:00
Ravi Kandhadai
03c6365671 [oslog][stdlib-private] Add support for interpolating strings
in the new os_log APIs.
2019-08-30 17:04:39 -07:00
Ravi Kandhadai
8641dc7310 [oslog][stdlib-private] Refactor and generalize implementation of
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.
2019-08-24 19:08:55 -07:00
Steve (Numerics) Canon
0fb8510da3 Replace @_fixed_layout with @frozen in private/OSLog
This one slipped through when the main search and replace pass happened,
becausee it's not in public.
2019-07-29 13:48:35 -04:00
Ravi Kandhadai
7a3c6d58f5 [stdlib][oslog] Create an SPI _globalStringTablePointer that exposes
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.
2019-07-03 17:25:37 -07:00
Ravi Kandhadai
27eefd7311 [os_log][SIL Optimization] Make new os log APIs @_transparent and
change OSLogOptimization pass so that inlining is not performed.
2019-06-11 15:47:21 -07:00
Ravi Kandhadai
9be4fef53a [SIL Optimization] Add a mandatory optimization pass for optimizing
the new os log APIs based on string interpolation.
2019-05-14 18:08:59 -07:00
Ravi Kandhadai
37f00edabc [os_log][stdlib-private] Refactor implementation and add optimization
attributes to the new os log APIs based on string interpolation so
that it can be optimized by the new OSLogOptimization compiler pass.
2019-05-01 15:42:37 -07:00
Ravi Kandhadai
592bca7202 [oslog] [stdlib-private] Add a prototype of the new os_log swift APIs
that accept string interpolations.

The prototypes are added to stdlib/private directory and will be
used only in tests and in experimental code.
2019-03-14 15:26:21 -07:00