From 2d10258a31a6d05368dfd4442c4aaa7b54614f1e Mon Sep 17 00:00:00 2001 From: Alok Kumar Sharma Date: Mon, 20 Jul 2020 19:50:37 +0530 Subject: [DebugInfo] Support for DW_AT_associated and DW_AT_allocated. Summary: This support is needed for the Fortran array variables with pointer/allocatable attribute. This support enables debugger to identify the status of variable whether that is currently allocated/associated. for pointer array (before allocation/association) without DW_AT_associated (gdb) pt ptr type = integer (140737345375288:140737354129776) (gdb) p ptr value requires 35017956 bytes, which is more than max-value-size with DW_AT_associated (gdb) pt ptr type = integer (:) (gdb) p ptr $1 = for allocatable array (before allocation) without DW_AT_allocated (gdb) pt arr type = integer (140737345375288:140737354129776) (gdb) p arr value requires 35017956 bytes, which is more than max-value-size with DW_AT_allocated (gdb) pt arr type = integer, allocatable (:) (gdb) p arr $1 = Testing - unit test cases added - check-llvm - check-debuginfo Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D83544 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp') diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 4cab4e0..7d410b2 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -1632,6 +1632,8 @@ void ModuleBitcodeWriter::writeDICompositeType( Record.push_back(VE.getMetadataOrNullID(N->getRawIdentifier())); Record.push_back(VE.getMetadataOrNullID(N->getDiscriminator())); Record.push_back(VE.getMetadataOrNullID(N->getRawDataLocation())); + Record.push_back(VE.getMetadataOrNullID(N->getRawAssociated())); + Record.push_back(VE.getMetadataOrNullID(N->getRawAllocated())); Stream.EmitRecord(bitc::METADATA_COMPOSITE_TYPE, Record, Abbrev); Record.clear(); -- cgit v1.1