-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Swiftify] add debug logs for safe interop #81663
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
Conversation
@swift-ci please smoke test |
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.
This LGTM, but I'm not sure familiar with what conventions are around inserting normally-inert debug statements like this in the Swift compiler source, so I advise waiting for at least one more approval from someone with more experience in this code base than me.
@swift-ci please smoke test |
b5cb83e
to
cc4435a
Compare
@swift-ci please smoke test |
spanAvailability: String? = nil, | ||
typeMappings: [String: String] = [:]) = | ||
typeMappings: [String: String] = [:], | ||
debug: Bool = false) = |
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.
@DougGregor do you think including conditionally enableable debug logging in the macro is reasonable, or is that a no-no in the stdlib?
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 don't really love the idea of putting the debug parameter into the macro itself, and I don't know that it even really works to have the macro printing things to standard output. For this functionality (what's the input to the macro?), I'd rather have that as part of the compiler's debugging flag.
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.
Oh that's a good point, that doesn't need to be specific to this macro
These can be enabled with `-Xcc -mllvm -debug-only=macros`.
This is a pure refactor to enable using PrintAST in the next commit.
cc4435a
to
149828f
Compare
@swift-ci please smoke test |
The argument list is going to be mostly empty if PrintExprs is not enabled. Always trying to print the arguments also broke quite a few tests, because it would result in a mismatch between the swift interface before and after serialization, since CustomAttr arguments are not serialized.
@swift-ci please smoke test |
This adds some dynamically togglable debug logs for the
swiftify
function in the ClangImporter under-Xllvm -debug-only=safe-interop-wrappers
, and for the_SwiftifyImport
macro under-Xllvm -debug-only=swiftify-import