-
Notifications
You must be signed in to change notification settings - Fork 343
[lldb] Update for removal of SourceFile::addImports #1079
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
[lldb] Update for removal of SourceFile::addImports #1079
Conversation
73bd5bd
to
7fae3a0
Compare
Additional modules to implicitly import now need to be provided upfront when constructing the ModuleDecl. To enable this change, split `PerformUserImport` into `GetImplicitImports`, which retrieves the necessary modules to import, and `CacheUserImports`, which deals with caching the imports from the parsed source file such that they're available to future expression evaluations. This commit also renames `PerformAutoImport` to `GetCompileUnitImports` to better match the other two methods.
Imports need to be resolved before the SwiftASTManipulator is run, as it can query interface types.
7fae3a0
to
f53d12b
Compare
@swift-ci please 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.
Mechanically this looks fine. Are you expecting any behavioral difference from the new API?
Also please note that will have to create a sibling PR for swift/master-next, there is no autromerger in that direction.
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 looks fine.
Thanks for the review!
No, it should do the same thing as the old API, the only difference being that import resolution now handles adding the imports to the file. |
@swift-ci please test |
To complement the bf16 expansion and truncation patterns added to ExpandOps, define a pass that replaces, for any arithmetic operation op, %y = arith.op %v0, %v1, ... : T with %e0 = arith.expf %v0 : T to U %e1 = arith.expf %v1 : T to U ... %y.exp = arith.op %e0, %e1, ... : U %y = arith.truncf %y.exp : U to T This allows for "emulating" floating-point operations not supported on a given target (such as bfloat operations or most arithmetic on 8-bit floats) by extending those types to supported ones, performing the arithmetic operation, and then truncating back to the original type (which ensures appropriate rounding behavior). The lowering of the extf and truncf ops introduced by this transformation should be handled by subsequent passes. Reviewed By: rsuderman Differential Revision: https://reviews.llvm.org/D154539
swiftlang/swift#31016 removes this API. Additional modules to be implicitly imported now need to be provided upfront when constructing the
ModuleDecl
.To enable this change, split
PerformUserImport
intoGetImplicitImports
, which retrieves the necessary modules to import, andCacheUserImports
, which deals with caching the imports from the parsed source file such that they're available to future expression evaluations.Note I'm not planning on merging this until after the 5.3 re-branch.