Skip to content

[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

Merged

Conversation

hamishknight
Copy link

@hamishknight hamishknight commented Apr 14, 2020

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 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.

Note I'm not planning on merging this until after the 5.3 re-branch.

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.
@hamishknight hamishknight force-pushed the a-balance-of-payments-deficit branch from 7fae3a0 to f53d12b Compare April 15, 2020 01:14
@hamishknight
Copy link
Author

swiftlang/swift#31016

@swift-ci please test

Copy link

@adrian-prantl adrian-prantl left a 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.

@adrian-prantl adrian-prantl requested a review from dcci April 15, 2020 01:35
Copy link
Member

@dcci dcci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine.

@hamishknight
Copy link
Author

Thanks for the review!

Are you expecting any behavioral difference from the new API?

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.

@hamishknight
Copy link
Author

swiftlang/swift#31016

@swift-ci please test

@hamishknight hamishknight merged commit 803d1b1 into swiftlang:swift/master Apr 20, 2020
@hamishknight hamishknight deleted the a-balance-of-payments-deficit branch April 20, 2020 23:51
swift-ci pushed a commit that referenced this pull request Jul 11, 2023
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants