-
Notifications
You must be signed in to change notification settings - Fork 421
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
Simplify convert-uast's handling of SymExprs and similar #25946
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DanilaFe
approved these changes
Sep 16, 2024
DanilaFe
approved these changes
Sep 16, 2024
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.
Everything looks good, thanks for implementing the suggestions!
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
Need to use 'explicit' since implicit conversion not needed here. --- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
--- Signed-off-by: Michael Ferguson <mppf@users.noreply.github.com>
mppf
force-pushed
the
convert-two-pass
branch
from
September 24, 2024 19:14
9a5ac1e
to
9bb63b3
Compare
1 task
mppf
added a commit
that referenced
this pull request
Sep 24, 2024
This PR fixes a compilation failure for frontend/ when compiling with clang. Follow-up to PR #25946. Reviewed by @jabraham17 - thanks! - [x] full comm=none testing
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR makes incremental progress towards having convert-uast handle more of the fully resolved data.
It does the following:
Converter
for all modules and do fixups at the end. To accomplish this, added a wrapper classUastConverter
, which contains a pointer to the realConverter
in a way that allows the implementation details ofConverter
to be private toconvert-uast.cpp
. This involved adjustingparseAndConvert.cpp
which calls the functionality inconvert-uast.cpp
; now it creates aUastConverter
and passes it to a few functions, calling methods on it to convert uAst to AST.ConvertedSymbolsMap
. A fixup is needed when the process of converting uAST to AST encounters something that refers to some uAST that is not converted yet. Previous to this PR, fixups were processed at the end of whatever syntactic construct contains both the SymExpr and the target Symbol, but since this could not be relied on in all cases, there was also a global fixups table. The problems with this approach are 1) it makes this code significantly more complicated 2) it can't apply to Types or handle point-of-instantiation in any reasonable way and 3) it does not offer significant performance improvement (as measured with--dyno-scope-bundled
). So, this PR removesConvertedSymbolsMap
and folds the relevant structures intoConverter
so that there is only one mapping of how a symbol/type was converted and only one list of fixups. (There are different fixups lists for different types of things as they are processed differently; but there is no longer a chain ofConvertedSymbolsMap
each containing fixups lists).TemporaryConversionType
which can be used when a type is known but the type has not yet been converted. This is similar toTemporaryConversionSymbol
but for types.wellknown.cpp
/wellknown.h
to considerdtCPointer
anddtCPointerConst
to be well-known types that need to be handled in a manner similar tostring
andbytes
records. These will have a dummyAggregateType
created early in compilation and the details will be filled in when processing the relevant declarations from the module code.dtCPointer
anddtCPointerConst
are used inconvert-uast.cpp
when converting C pointer types because the type system infrontend/
has its own representation for these apart from these classes in the modules.For https://github.com/Cray/chapel-private/issues/6261
Reviewed by @DanilaFe - thanks!