[PATCH] D54114: Adding debug info to support Fortran (part 2)

Eric Schweitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 09:50:09 PST 2018


schweitz added inline comments.


================
Comment at: include/llvm/IR/DIBuilder.h:491
 
+    /// Create debugging information entry for a Fortran array.
+    /// \param Size         Array size.
----------------
JohnReagan wrote:
> So what's the difference here between createArrayType and createFortranArrayType?  They both take subranges for subscripts, yes?  The size would be a run-time value if any of the subranges have non-constant values but your createFortranArrayType handles that case and can be folded in.
We've been propagating changes to LLVM for Fortran compilers for many LLVM releases now off-stream.  There are a number of reasons why it was easier to make a "higher level" break like this. If these changes can be successfully upstreamed, then many of those arguments become historical.



================
Comment at: include/llvm/IR/DIBuilder.h:582
 
+    /// Create a descriptor for a value range.  This
+    /// implicitly uniques the values returned.
----------------
JohnReagan wrote:
> Why not 
> 
> ```
> getOrCreateSubrangeWithCount(Metadata *Lo, Metadata *CountNode);
> getOrCreateSubrangeWithUpper(Metadata *Lo, Metadata *Up);
> ```
> 
> or something like this?  I can imagine where the Upper value is easier to describe than the Count.  On VMS, our array descriptors have bounds information inside of them so the Lo/Up values are just "descriptor-base + offset".  Trying to describe the count would involve generating code into a temp variable or using a more complex DWARF expression to fetch the Lo and Up and doing the arithmetic that way.
> 
> And your comments don't describe the arguments so perhaps I'm missing something.
> 
I think the information in the summary section shows some of the details concerning the properties our Fortran compilers need.  Specifically, both a lower bound and an upper bound, either of which can be constant or computed from a dope vector or omitted iff it is an upper bound in the right-most rank.

Our compilers don't use count (extent) to imply an upper bound.



Repository:
  rL LLVM

https://reviews.llvm.org/D54114





More information about the llvm-commits mailing list