[DebugInfo] Upgrade DISubragne::count to accept DIExpression also

Authored by alok on Mar 25 2021, 4:04 AM.


[DebugInfo] Upgrade DISubragne::count to accept DIExpression also

This is needed for Fortran assumed shape arrays whose dimensions are
defined as,

  • 'count' is taken from array descriptor passed as parameter by caller, access from descriptor is defined by type DIExpression.
  • 'lowerBound' is defined by callee.

The current alternate way represents using upperBound in place of
count, where upperBound is calculated in callee in a temp variable
using lowerBound and count

Representation with count (DIExpression) is not only clearer as
compared to upperBound (DIVariable) but it has another advantage that
variable count is accessed by being parameter has better chance of
survival at higher optimization level than upperBound being local

Reviewed By: aprantl

Differential Revision: https://reviews.llvm.org/D99335