-
Notifications
You must be signed in to change notification settings - Fork 341
Add progress reports for bridging header compilation. #8103
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
Add progress reports for bridging header compilation. #8103
Conversation
to report Size/Align info and continue with the Swift language runtime. This would otherwise cause a fallback to SwiftASTContext and a TypeSystemSwiftTypeRef/SwiftASTContext verification error.
…vm#79912) The `total` parameter for the constructor for Progress was changed to a std::optional in llvm#77547. It was originally set to 1 to indicate non-determinisitic progress, but this commit changes this. First, `UINT64_MAX` will again be used for non-deterministic progress, and `Progress` now has a static variable set to this value so that we can use this instead of a magic number. The member variable `m_total` could be changed to a std::optional as well, but this means that the `ProgressEventData::GetTotal()` (which is used for the public API) would either need to return a std::optional value or it would return some specific integer to represent non-deterministic progress if `m_total` is std::nullopt. (cherry picked from commit 733b86d)
test with swiftlang/swift#71318 |
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.
LGTM with some comments.
: module_name.str())); | ||
[&progress](llvm::StringRef module_name, | ||
swift::ASTContext::ModuleImportKind kind) { | ||
progress.Increment(1, (kind == swift::ASTContext::Overlay |
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.
Should we have a switch here now that we have 3 kinds of module imports ?
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.
Honestly I think even the overlay case makes no sense here since the stdlib is always a pure Swift module. I just left it in because it was there before.
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.
Fair
: module_name.str())); | ||
[&progress](llvm::StringRef module_name, | ||
swift::ASTContext::ModuleImportKind kind) { | ||
progress.Increment(1, (kind == swift::ASTContext::Overlay |
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.
ditto
case swift::ASTContext::Module: | ||
progress.Increment(1, module_name.str()); | ||
break; | ||
case swift::ASTContext::Overlay: | ||
progress.Increment(1, module_name.str() + " (overlay)"); | ||
break; | ||
case swift::ASTContext::BridgingHeader: | ||
progress.Increment(1, | ||
"Compiling bridging header: " + module_name.str()); | ||
break; |
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.
In the swift::ASTContext::Module
case, we only put the name of the module, if it's an overlay, we show both the name and (overlay)
annotation, but if it's a bridging header, we now show Compiling bridging header:
with the module name.
I don't have any preference but let's stay consistent across all the Increment
updated_detail
string.
Requires swiftlang/swift#71318
I needed to cherry-pick a dependency from upstream and also make a drive-by fix in TypeSystemSwiftTypeRef so the test doesn't assert.