[PATCH] D122584: [DebugInfo] Use DW_ATE_signed encoding when creating a Fortran array index type.

Chih-Ping Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 07:44:05 PDT 2022


cchen15 added inline comments.


================
Comment at: llvm/include/llvm/BinaryFormat/Dwarf.h:324
+inline TypeKind getArrayIndexTypeEncoding(SourceLanguage S) {
+  return isFortran(S) ? DW_ATE_signed : DW_ATE_unsigned;
+}
----------------
JohnReagan wrote:
> I don't like picking the type encoding based on the language.  Pascal also allows negative array bounds.  The encoding should be derived from the type specified or from some additional attribute set by the frontend.  I'll want this for my Pascal (and Fortran) compilers.
Correctly describing a Pascal's array index type provides a strong argument for adding an 'index type' field to DISubrange.

The target language of this PR is Fortran, so my apologies for the narrow scope of this change to get what Fortran needs while keeping the index type encoding for other languages the same as before the change.
 


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D122584/new/

https://reviews.llvm.org/D122584



More information about the llvm-commits mailing list