[PATCH] D65914: [Dwarf] DW_TAG_unspecified_type is a type tag.

Jonas Devlieghere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 7 17:46:50 PDT 2019


JDevlieghere created this revision.
JDevlieghere added a reviewer: aprantl.
Herald added a project: LLVM.

This fixes an incorrect verifier error for a `DW_AT_type` pointing to `DW_TAG_unspecified_type`.

  error: DIE has DW_AT_type with incompatible tag DW_TAG_unspecified_type


Repository:
  rL LLVM

https://reviews.llvm.org/D65914

Files:
  llvm/include/llvm/BinaryFormat/Dwarf.h
  llvm/test/DebugInfo/X86/template.ll


Index: llvm/test/DebugInfo/X86/template.ll
===================================================================
--- llvm/test/DebugInfo/X86/template.ll
+++ llvm/test/DebugInfo/X86/template.ll
@@ -1,6 +1,7 @@
 ; REQUIRES: object-emission
 
 ; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s | llvm-dwarfdump -v -debug-info - | FileCheck %s
+; RUN: llc -mtriple=x86_64-linux -O0 -filetype=obj < %s | not llvm-dwarfdump -verify - | FileCheck %s --check-prefix VERIFY
 
 ; IR generated with `clang++ -g -emit-llvm -S` from the following code:
 ; template<int x, int*, template<typename> class y, decltype(nullptr) n, int ...z>  int func() {
@@ -11,6 +12,9 @@
 ; int glbl = func<3, &glbl, y_impl, nullptr, 1, 2>();
 ; y_impl<int>::nested n;
 
+; VERIFY-NOT: error: DIE has DW_AT_type with incompatible tag DW_TAG_unspecified_type
+; VERIFY: error: DIEs have overlapping address ranges
+
 ; CHECK: [[INT:0x[0-9a-f]*]]:{{ *}}DW_TAG_base_type
 ; CHECK-NEXT: DW_AT_name{{.*}} = "int"
 
Index: llvm/include/llvm/BinaryFormat/Dwarf.h
===================================================================
--- llvm/include/llvm/BinaryFormat/Dwarf.h
+++ llvm/include/llvm/BinaryFormat/Dwarf.h
@@ -108,6 +108,7 @@
   case DW_TAG_file_type:
   case DW_TAG_packed_type:
   case DW_TAG_volatile_type:
+  case DW_TAG_unspecified_type:
   case DW_TAG_typedef:
     return true;
   default:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65914.214044.patch
Type: text/x-patch
Size: 1373 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190808/e8a74544/attachment.bin>


More information about the llvm-commits mailing list