Skip to content
Commit ca46521a authored by Jean Perier's avatar Jean Perier
Browse files

[flang] UBOUND() edge case: empty dimension

Similarly to LBOUND in https://reviews.llvm.org/D121488, UBOUND must
return zero for an empty dimension, no matter the specification
expression.

Add a GetUBOUND method to be used in expression rewrite that prevents
folding UBOUND to a bound specification expression if the extent is
not a compile time constant.

Fold the case where the extents is known to be zero (and also deal with
this case in LBOUND since we can and should to comply with constant
expression requirements).

Differential Revision: https://reviews.llvm.org/D122242
parent 88d5289f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment