[LLVMdev] debug metadata for variable length arrays ?

sebastien deldon (PGI) sebastien.deldon at pgroup.com
Mon Nov 4 09:43:50 PST 2013


Is there any debug metadata to use for variable length arrays:

I picked this C example:

int vla(int n)
{
    int aaa[n][n+3];
    int i, j ;

    for (i=0 ; i<n; i++)
        for (j=0; j<n+3;  j++)
            aaa[i][j] = (i+j*n)%1023;
    return aaa[n-1][0];
}

int main(int argc, char** argv)
{
    return vla(argc+5);
}

How do  I express range for 'aaa' array ?
I would need this for Fortran like languages where bounds can be defined as:

SUBROUTINE foo(x_min,x_max,y_min,y_max,                &
                            aaa &
                              )

  IMPLICIT NONE

  INTEGER :: x_min,x_max,y_min,y_max
  REAL(KIND=8), DIMENSION(x_min-2:x_max+2,y_min-2:y_max+2) :: aaa
...

Any advice on how to use debug metadata to generate DWARF for those case is welcome.

Seb

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131104/5ea97806/attachment.html>


More information about the llvm-dev mailing list