Skip to content

Commit e2835f5

Browse files
committed
---
yaml --- r: 319355 b: refs/heads/master-rebranch c: eff9307 h: refs/heads/master i: 319353: 2a3c575 319351: 11b6d26
1 parent 76934ae commit e2835f5

26 files changed

+1195
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1457,4 +1457,4 @@ refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-02-a: ddd2b2976aa9bfde5f20fe37f6bd2
14571457
refs/tags/swift-DEVELOPMENT-SNAPSHOT-2019-08-03-a: 171cc166f2abeb5ca2a4003700a8a78a108bd300
14581458
refs/heads/benlangmuir-patch-1: baaebaf39d52f3bf36710d4fe40cf212e996b212
14591459
refs/heads/i-do-redeclare: 8c4e6d5de5c1e3f0a2cedccf319df713ea22c48e
1460-
refs/heads/master-rebranch: e5193611949eac03c9745f26c28ef5a68c5041ac
1460+
refs/heads/master-rebranch: eff930708c226105618e5f076c1168a768ffa79c

branches/master-rebranch/include/swift/AST/DiagnosticsSIL.def

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,27 @@ NOTE(switch_value_case_doesnt_yield, none, "missing yield in the %0 case",
470470
NOTE(try_branch_doesnt_yield, none, "missing yield when error is "
471471
"%select{not |}0thrown", (bool))
472472

473+
// OS log optimization dianostics.
474+
475+
ERROR(oslog_message_argument_not_found, none, "no argument of type %0 in "
476+
" the os log call", (Identifier))
477+
478+
ERROR(oslog_dynamic_message, none, "os log methods must be passed a string "
479+
"interpolation literal. 'OSLogMessage' must not be constructed explicitly",
480+
())
481+
482+
ERROR(oslog_const_evaluation_error, none, "constant evaluating 'OSLogMessage'"
483+
"implementation failed.", ())
484+
485+
ERROR(oslog_non_constant_message, none, "'OSLogMessage' struct is "
486+
"unoptimizable: 'init' is not constant evaluable", ())
487+
488+
ERROR(oslog_non_constant_interpolation, none, "'OSLogInterpolation' struct is "
489+
"unoptimizable: 'init' is not constant evaluable", ())
490+
491+
ERROR(oslog_property_not_constant, none, "'OSLogInterpolation.%0' is not a "
492+
"constant: formatting and privacy options must be literals", (StringRef))
493+
473494
#ifndef DIAG_NO_UNDEF
474495
# if defined(DIAG)
475496
# undef DIAG

branches/master-rebranch/include/swift/AST/KnownIdentifiers.def

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@ IDENTIFIER_(ErrorType)
178178
IDENTIFIER(Code)
179179
IDENTIFIER_(nsError)
180180

181+
// Custom string interpolation type used by os log APIs.
182+
IDENTIFIER(OSLogMessage)
183+
181184
#undef IDENTIFIER
182185
#undef IDENTIFIER_
183186
#undef IDENTIFIER_WITH_NAME

branches/master-rebranch/include/swift/SILOptimizer/PassManager/Passes.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ PASS(SerializeSILPass, "serialize-sil",
309309
"Utility pass. Serializes the current SILModule")
310310
PASS(YieldOnceCheck, "yield-once-check",
311311
"Check correct usage of yields in yield-once coroutines")
312+
PASS(OSLogOptimization, "os-log-optimization", "Optimize os log calls")
312313
PASS(BugReducerTester, "bug-reducer-tester",
313314
"sil-bug-reducer Tool Testing by Asserting on a Sentinel Function")
314315
PASS_RANGE(AllPasses, AADumper, BugReducerTester)

branches/master-rebranch/lib/SILOptimizer/Mandatory/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ silopt_register_sources(
2020
SemanticARCOpts.cpp
2121
SILGenCleanup.cpp
2222
YieldOnceCheck.cpp
23+
OSLogOptimization.cpp
2324
)

0 commit comments

Comments
 (0)