PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

[fparser2-FE] Select-type support uses string to communicate type of the type-selector variable.

Open arporter opened this issue 1 year ago • 0 comments

#2229 and PR #2396 add support (to the fparser2 PSyIR frontend) for separating the control-flow logic of a select-type from the statements within each branch. This is done by creating a CodeBlock containing a SelectType that stores the run-time-resolved type of the type-selector variable as a string. @sergisiso pointed out:

Choosing a string to communicate the type is quite inefficient. It could simply be an integer (or even a short) and it would communicate the type with a fraction of the memory, it would not have the "too long" issue and the equality operator is much faster than a string comparison. (the string may be a bit better for readability, but this can be also done in the integer with a preceding comment explaining the meaning of the integer value)

In this issue we'll change the type of the variable from string to integer.

arporter avatar Apr 15 '24 14:04 arporter