[PATCH] D36480: [LLVM] Change to Verifier to allow Fortran CHARACTER types in debug information

Eric Schweitz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 17:48:53 PDT 2017


schweitz added a comment.

In https://reviews.llvm.org/D36480#836117, @aprantl wrote:

> Hmm.. when I'm running your test I get:
>
>   0x00000056:   DW_TAG_string_type [4]  
>                   DW_AT_name [DW_FORM_strp]	( .debug_str[0x00000026] = "character")
>                   DW_AT_encoding [DW_FORM_data1]	(DW_ATE_signed)
>                   DW_AT_byte_size [DW_FORM_data1]	(0x01)
>  
>   0x0000005d:   NULL
>
>
> But the standard says in 5.11:
>
> > A string type entry may have a DW_AT_type attribute describing how each
> >  character is encoded and is to be interpreted. The value of this attribute is a
> >  reference to a DW_TAG_base_type base type entry. If the attribute is absent, then
> >  the character is encoded using the system default.


Well, this isn't a DW_TAG_base_type, which is what section 5.1 concerns. The test overrides the tag to be DW_TAG_string_type.

It is true that we really don't need DW_AT_encoding for DW_TAG_string_type.

Ultimately, a new !DIStringType will be added. But for now baby steps to get off the ground.



================
Comment at: string-type.ll     :2
+; RUN: %llc_dwarf %s -filetype=obj -o %t
+; RUN: llvm-dwarfdump =debug-dump=info %t | FileCheck %s
+; CHECK: DW_TAG_string_type
----------------
aprantl wrote:
> `=debug-dump=info` -> `-debug-dump=info`
Fixed in last attached diff.


================
Comment at: string-type.ll     :16
+!2 = !{ i32 1, !"Debug Info Version", i32 3 }
+!3 = !DIFile(filename: "fortran", directory: "/")
+!5 = !{  }
----------------
aprantl wrote:
> shouldn't this be something.f90? :-)
Added a more snazzy name as well. ;)


https://reviews.llvm.org/D36480





More information about the llvm-commits mailing list