[PATCH] D36480: [LLVM] Change to Verifier to allow Fortran CHARACTER types in debug information
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 9 10:56:14 PDT 2017
aprantl added a comment.
I just looked at how C arrays are represented.
for `char s[3];` we currently generate:
!6 = !DICompositeType(tag: DW_TAG_array_type, baseType: !7, size: 24, elements: !8)
!7 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
!8 = !{!9}
!9 = !DISubrange(count: 3)
We could similarly use DICompositeType as a vehicle for the Fortran strings, with the baseType field being optional, so we can represent a nonstandard encoding if necessary, but don't have to when the default encoding is used.
With DICompositeType our `character(3)` would look like this:
`!DICompositeType(tag: DW_TAG_string_type, name: "character(3)", size: 24, align: 8)`
Having separate names for each length of string seems to be a bit wasteful, but probably isn't too bad.
How you are planning to represent variable-length strings?
https://reviews.llvm.org/D36480
More information about the llvm-commits
mailing list