Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SIL Optimization][OSLogOptimization] Improve the logic for discovering the beginning of the string interpolation passed to os log APIs. #27419

Merged

Conversation

@ravikandhadai
Copy link
Contributor

commented Sep 29, 2019

This PR updates the beginOfInterpolation function of the OSLogOptimization that extracts the first instruction generated for an interpolated string literal from which the constant evaluation must begin. The old implementation assumed a certain pattern of SIL generation for interpolated literals. The new implementation eliminates this assumption and follows the chain of dependencies starting
from an initializer call to OSLogMessage until the first instruction of interpolation is discovered. This is more robust towards changes to the SIL generation of string interpolation literals.

This change will also fix the errors in this PR: #27391 created by @brentdax

discovering the beginning of the string interpolation passed
to os log APIs.

The implementation follows the chain of dependencies starting
from an initializer call to OSLogMessage until the first
instruction of interpolation is discovered. This is more
robust towards changes to the SIL generation of string
interpolation literals.
@ravikandhadai ravikandhadai requested review from brentdax and devincoughlin Sep 29, 2019
@ravikandhadai

This comment has been minimized.

Copy link
Contributor Author

commented Sep 29, 2019

@swift-ci Please test

Copy link
Contributor

left a comment

SILOptimizer is not exactly my area of expertise, but this LGTM. Thanks!

@ravikandhadai ravikandhadai merged commit af5eda5 into apple:master Oct 2, 2019
4 checks passed
4 checks passed
Swift Test Linux Platform No test results found.
Details
Swift Test Linux Platform (smoke test)
Details
Swift Test OS X Platform No test results found.
Details
Swift Test OS X Platform (smoke test)
Details
@compnerd

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.