[PATCH] D83544: [DebugInfo] Support for DW_AT_associated and DW_AT_allocated.

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 11:48:51 PDT 2020


aprantl added a comment.

Mechanically, this looks great! it would be good to add a little more context to the LangRef documentation (see my inline comment).



================
Comment at: llvm/docs/LangRef.rst:4861
+has the address of the actual raw data. The optional ``associated`` is a
+DIExpression that describes whether the pointer array is currently associated.
+The optional ``allocated`` is a DIExpression that describes whether the
----------------
Thank you for updating LangRef!
For someone unfamiliar with the concept of an associated array, it would be great to add a sentence that explains that this is a Fortran feature and what it means in broad terms.


================
Comment at: llvm/include/llvm/IR/DebugInfoMetadata.h:945
           DIDerivedType *Discriminator, Metadata *DataLocation,
-          StorageType Storage, bool ShouldCreate = true) {
+          Metadata *Associated, Metadata *Allocated, StorageType Storage,
+          bool ShouldCreate = true) {
----------------
@dblaikie At some point I'm going to become concerned by the number of pointer-sized fields in DICompositeType and recommend to split it up into subclasses for C++ and Fortran. But maybe we're not there yet.

Apparently in a current Clang we have 

```
$ dwarfdump bin/clang.dSYM | egrep '(DW_TAG_class_type|DW_TAG_structure_type)' |wc -l
 1011605
```

on the order of a million unique types, so this patch adds ~16Mb to a full LTO build of Clang. That honestly does not sound too bad.


================
Comment at: llvm/test/DebugInfo/X86/dwarfdump-allocatedExp.ll:6
+; CHECK-LABEL:  DW_TAG_array_type
+; CHECK:        DW_AT_allocated (DW_OP_push_object_address, DW_OP_deref)
+; CHECK:       DW_TAG_subrange_type
----------------
add `CHECK-NOT: DW_TAG` in between to ensure we're still in the same TAG


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83544





More information about the llvm-commits mailing list