-
Couldn't load subscription status.
- Fork 10.6k
[ClangImporter] improve structure of swiftify debug logs #85129
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
base: main
Are you sure you want to change the base?
[ClangImporter] improve structure of swiftify debug logs #85129
Conversation
...with bounds attributes This creates safe overloads for any methods in the protocol annotated with bounds information. Updates _SwiftifyImportProtocol to make the added overloads in the protocol public. rdar://144335990
This adds automatic scope management and indentation to the logs to make them more structured. Also adds some additional logging. Here's an example of what it can look like now: ``` [swiftify:593] Checking 'CountedByProtocol' protocol for methods with bounds and lifetime info [swiftify:350] | Checking 'simple::' for bounds and lifetime info [swiftify:411] | | Checking parameter 'len' with type 'int' [swiftify:411] | | Checking parameter 'p' with type 'int * __counted_by(len)' [swiftify:435] | | | Found bounds info 'int * __counted_by(len)' [swiftify:350] | Checking 'shared:::' for bounds and lifetime info [swiftify:411] | | Checking parameter 'len' with type 'int' [swiftify:411] | | Checking parameter 'p1' with type 'int * __counted_by(len)' [swiftify:435] | | | Found bounds info 'int * __counted_by(len)' [swiftify:411] | | Checking parameter 'p2' with type 'int * __counted_by(len)' [swiftify:435] | | | Found bounds info 'int * __counted_by(len)' [swiftify:350] | Checking 'complexExpr:::' for bounds and lifetime info [swiftify:411] | | Checking parameter 'len' with type 'int' [swiftify:411] | | Checking parameter 'offset' with type 'int' [swiftify:411] | | Checking parameter 'p' with type 'int * __counted_by(len - offset)' [swiftify:435] | | | Found bounds info 'int * __counted_by(len - offset)' [swiftify:350] | Checking 'nullUnspecified::' for bounds and lifetime info [swiftify:411] | | Checking parameter 'len' with type 'int' [swiftify:411] | | Checking parameter 'p' with type 'int * __counted_by(len) _Null_unspecified' [swiftify:435] | | | Found bounds info 'int * __counted_by(len) _Null_unspecified' [swiftify:350] | Checking 'nonnull::' for bounds and lifetime info [swiftify:411] | | Checking parameter 'len' with type 'int' [swiftify:411] | | Checking parameter 'p' with type 'int * __counted_by(len) _Nonnull' [swiftify:435] | | | Found bounds info 'int * __counted_by(len) _Nonnull' [swiftify:350] | Checking 'nullable::' for bounds and lifetime info [swiftify:411] | | Checking parameter 'len' with type 'int' [swiftify:411] | | Checking parameter 'p' with type 'int * __counted_by(len) _Nullable' [swiftify:435] | | | Found bounds info 'int * __counted_by(len) _Nullable' [swiftify:350] | Checking 'returnPointer:' for bounds and lifetime info [swiftify:379] | | Found bounds info 'int * __counted_by(len)' on return value [swiftify:411] | | Checking parameter 'len' with type 'int' [swiftify:350] | Checking 'staticMethod::' for bounds and lifetime info [swiftify:411] | | Checking parameter 'len' with type 'int' [swiftify:411] | | Checking parameter 'p' with type 'int * __counted_by(len)' [swiftify:435] | | | Found bounds info 'int * __counted_by(len)' ```
| extension OverloadedProtocol { | ||
| /// This is an auto-generated wrapper for safer interop | ||
| @_alwaysEmitIntoClient @_disfavoredOverload | ||
| @_alwaysEmitIntoClient @_disfavoredOverload public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a change from #85123. The first three commits are from that PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure whether it's the right thing to do though, now that you think about it. I'll have to look into it a bit more.
This adds automatic scope management and indentation to the logs to make
them more structured. Also adds some additional logging.
Here's an example of what it can look like now:
Based on top of #85123