-
Notifications
You must be signed in to change notification settings - Fork 299
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
Improve #9399 using additions from #9408 #9427
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
- Use a map (string, record Declaration) to keep a track of records in the SimCode. This allows for a simpler and quicker check. In addition we can update entries easily.
- See what fails in the testsuite. - It was actually affecting some tests because nested records were cycling back and messing with the order. Not exactly sure how but is not relevant anymore.
- Remove returned lists from functions: elaborateNestedRecordDeclarations elaborateRecordDeclarationsFromTypes elaborateRecordDeclarationsForRecord elaborateNestedRecordDeclarations - Remove input lists from functions: - elaborateRecordDeclarationsFromTypes
- If an entry already exists in the map and we always update, then there is a chance we might overwrite a 'true' value with a 'false' value for external conversion marker. Check if the entry exists and if it is marked false while then new incoming entry is marked true, then update it. Otherwise do nothing.
- Remove input lists from functions: - elaborateNestedRecordDeclarations - elaborateRecordDeclarationsForRecord
- Removed from - elaborateRecordDeclarationsForMetarecords
- Remove input and output lists from functions: - elaborateFunctions2 - elaborateFunction
- Recursive functions converted to loops: - elaborateNestedRecordDeclarations - elaborateRecordDeclarationsForMetarecords - elaborateRecordDeclarationsFromTypes
- elaborateRecordDeclarationsForMetarecords -> collectRecDeclsFromMetaRecordCallExps - elaborateNestedRecordDeclarations -> collectRecDeclsFromTypesVars - elaborateRecordDeclarationsFromTypes -> collectRecDeclsFromTypes - elaborateRecordDeclarationsForRecord -> collectRecDeclsFromType
- Instead of: - traversing all expressions, collecting all meta record calls to a list, and then traversing this list to collect record declarations - collect record declarations while traversing all expressions (without collecting metarecordcalls into a whole new list.)
- elaborateRecordDeclarations -> collectRecDeclsFromElems
- Convert recursive functions to loops: - collectRecDeclsFromElems (used to be `elaborateRecordDeclarations`)
- declMap -> recDeclsMap - needsExternalConversion -> usedExternally
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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 improves the fix for #8591 (done in #9399) using the additional information from the NF provided by #9408.
After these changes, the NF will generate the additional external conversion code only when it is needed. The OF will still cause generation of unnecessary code. However, it is minimal or none for MetaModelica usage. For Modelica usage it generates more but is not supposed to be used for that purpose anymore. It only affects some tests in the test suite that still use the OF for now.
Use the externally used records marker.
Set marker to always be true for the OF.
Use a map/dictionary instead of keeping separate lists.
the SimCode. This allows for a simpler and quicker check. In addition
we can update entries easily.
Add MetaModelica records to the map as well.
Debug help
Fix traversal order to avoid possible(?) infinite recursion.
Disable the old creation of record declarations.
back and messing with the order. Not exactly sure how but is not
relevant anymore.
Simplify processing of record declrations.
Remove returned lists from functions:
elaborateNestedRecordDeclarations
elaborateRecordDeclarationsFromTypes
elaborateRecordDeclarationsForRecord
elaborateNestedRecordDeclarations
Remove input lists from functions:
Make sure we do not overwrite true values to false.
If an entry already exists in the map and we always update, then there
is a chance we might overwrite a 'true' value with a 'false' value
for external conversion marker.
Check if the entry exists and if it is marked false while then new
incoming entry is marked true, then update it. Otherwise do nothing.
Remove input lists from functions
Remove input and output lists from more functions.
Remove input and output lists from elaborateRecordDeclarations.
Remove input and output lists from more functions.
Convert recursive functions to loops.
Rename some functions to be more descriptive.
Change how records are collected from metarecordcalls
traversing all expressions, collecting all meta record calls to a list,
and then traversing this list to collect record declarations
collect record declarations while traversing all expressions (without
collecting metarecordcalls into a whole new list.)
Rename functions to be more descriptive.
Convert recursive functions to loops.
elaborateRecordDeclarations
)Some minor cleanup and renaming.