Commit cc6d66f
authored
Handle preExp and varDecls for crefs with subs. (#923)
* Handle preExp and varDecls for crefs with subs.
- We used to throw away any extra expressions and variable declarations
needed for it, i.e., if it has some complicated subscript that can not
be generated inline.
- If you are sure you have a path (a cref with no subs) then you can use
contextCrefNoPrevExp (e.g variable names are just paths. They are just
represented as cref). Otherwise contextCref now needs a preEx and varDecls
buffer passed to it.
* Fix wrong ordering of buffer arguments.
* Avoid unnecessary code generation.
- This fixes ticket:5994.
- The path we took for crefs with subscripts in function context
used to create unnecessary temporaries and exps which we did
not notice because they were were thrown away after being created.
- Split up the function to take different paths for normal and parallel
functions.
* Add a test case for Ticket:5994.1 parent 85508bb commit cc6d66f
File tree
5 files changed
+220
-145
lines changed- OMCompiler/Compiler/Template
- testsuite/simulation/modelica/arrays
5 files changed
+220
-145
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5501 | 5501 | | |
5502 | 5502 | | |
5503 | 5503 | | |
5504 | | - | |
| 5504 | + | |
5505 | 5505 | | |
5506 | 5506 | | |
5507 | 5507 | | |
| |||
5634 | 5634 | | |
5635 | 5635 | | |
5636 | 5636 | | |
5637 | | - | |
| 5637 | + | |
5638 | 5638 | | |
5639 | 5639 | | |
5640 | 5640 | | |
| |||
5660 | 5660 | | |
5661 | 5661 | | |
5662 | 5662 | | |
5663 | | - | |
| 5663 | + | |
5664 | 5664 | | |
5665 | 5665 | | |
5666 | 5666 | | |
5667 | 5667 | | |
5668 | | - | |
| 5668 | + | |
5669 | 5669 | | |
5670 | 5670 | | |
5671 | 5671 | | |
| |||
5970 | 5970 | | |
5971 | 5971 | | |
5972 | 5972 | | |
5973 | | - | |
| 5973 | + | |
5974 | 5974 | | |
5975 | 5975 | | |
5976 | 5976 | | |
| |||
0 commit comments