Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Codegen/fix record in function modification handling 2 (#490)
[NF/OF/Codegen] Fix handling of record variables with modifications on declaration in functions. NF: - Fix the new Front-end to mark modification bindings. OF: - Manually remove Prefixes from cref's TYPES_VARs. - Mark record EQBOUND bindings that are created from submods by the old front-end. - We will not generate code for these bindings. SimCode will skip them. They are redundant. The types_vars of the record variable already have the correct bindings. - They are also not 'properly' prefixed anymore since we do not prefix types_vars (the bindings are taken from the typesvars by the front end.) - The correct way to fix these would have been not to create eqmod modifications from submods in the first place. However it is impossible to fix that properly in short time (if possible at all). - Improve constant evaluation. - Try not to create DAE.EMPTY from Values.EMPTY(). - We usually have the original expression before ceval was applied. if ceval return values.empty use the original exp if available. - Fix match failures caused by unmatched Absyn.NO_MSG(). Use Absyn.MSG(dummy) always. We should probably just remove Absyn.Msg altogether. - Use the types_var bindings if no bindings are found in Env for records. - Remove error messages from constant evaluation failure. Failure to constant evaluate is not an error by itself. Codegen/SimCode: - We now create additional constructors for each unique modification use of a record. - For example R r(a=1), r(b=2) will use two different constructors. We only create these constructors if they are actually needed. - There are some optimizations and cleanups that can be done. Will be fixed afterwards. - Pass correct context to outside bindings in CodeGen. - Update expected outputs. - Some error messages are removed since they report failures in constant evaluation. Which is not technically an error.
- Loading branch information
Showing
28 changed files
with
494 additions
and
176 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.