Skip to content

Commit 1f53dac

Browse files
authored
---
yaml --- r: 349043 b: refs/heads/master c: 5e8c4ad h: refs/heads/master i: 349041: 756b945 349039: 2b2218b
1 parent 47469ae commit 1f53dac

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 5acc4175fdd7f447a653db205659a6be42468dbb
2+
refs/heads/master: 5e8c4ad494ef73aee7d86483b2b6789e82a530b5
33
refs/heads/master-next: 203b3026584ecad859eb328b2e12490099409cd5
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea

trunk/lib/SILOptimizer/Mandatory/OSLogOptimization.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -783,9 +783,9 @@ static ApplyInst *getAsOSLogMessageInit(SILInstruction *inst) {
783783
return nullptr;
784784
}
785785

786-
/// Return true iff this function is a protocol witness for
787-
/// ExpressibleByStringInterpolation.init(stringInterpolation:) in OSLogMessage.
788-
bool isAutoGeneratedInitOfOSLogMessage(SILFunction &fun) {
786+
/// Return true iff the SIL function \c fun is a method of the \c OSLogMessage
787+
/// type.
788+
bool isMethodOfOSLogMessage(SILFunction &fun) {
789789
DeclContext *declContext = fun.getDeclContext();
790790
if (!declContext)
791791
return false;
@@ -818,11 +818,15 @@ class OSLogOptimization : public SILFunctionTransform {
818818
return;
819819
}
820820

821-
// Skip the auto-generated (transparent) witness method of OSLogMessage,
822-
// which ends up invoking the OSLogMessage initializer:
823-
// "oslog.message.init_interpolation" but without an interpolated
824-
// string literal.
825-
if (isAutoGeneratedInitOfOSLogMessage(fun)) {
821+
// Skip methods of OSLogMessage type. This avoid unnecessary work and also
822+
// avoids falsely diagnosing the auto-generated (transparent) witness method
823+
// of OSLogMessage, which ends up invoking the OSLogMessage initializer:
824+
// "oslog.message.init_interpolation" without an interpolated string
825+
// literal that is expected by this pass.
826+
// TODO: this check can be eliminated if there is a separate pass for
827+
// diagnosing errors in the use of the OSLogMessage type, and this pass
828+
// bails out when a use of the type is not optimizable.
829+
if (isMethodOfOSLogMessage(fun)) {
826830
return;
827831
}
828832

trunk/utils/update_checkout/update-checkout-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"swift-format": {
5454
"remote": { "id": "apple/swift-format" } },
5555
"llvm-project": {
56-
"remote": { "id": "apple/llvm-project-v2" } }
56+
"remote": { "id": "apple/llvm-project-v3" } }
5757
},
5858
"default-branch-scheme": "master",
5959
"branch-schemes": {

0 commit comments

Comments
 (0)