Index: llvm/include/llvm/BinaryFormat/Dwarf.h =================================================================== --- llvm/include/llvm/BinaryFormat/Dwarf.h +++ llvm/include/llvm/BinaryFormat/Dwarf.h @@ -90,25 +90,33 @@ inline bool isType(Tag T) { switch (T) { case DW_TAG_array_type: + case DW_TAG_atomic_type: + case DW_TAG_base_type: case DW_TAG_class_type: - case DW_TAG_interface_type: + case DW_TAG_coarray_type: + case DW_TAG_const_type: + case DW_TAG_dynamic_type: case DW_TAG_enumeration_type: + case DW_TAG_file_type: + case DW_TAG_immutable_type: + case DW_TAG_interface_type: + case DW_TAG_packed_type: case DW_TAG_pointer_type: + case DW_TAG_ptr_to_member_type: case DW_TAG_reference_type: + case DW_TAG_restrict_type: case DW_TAG_rvalue_reference_type: + case DW_TAG_set_type: + case DW_TAG_shared_type: case DW_TAG_string_type: case DW_TAG_structure_type: + case DW_TAG_subrange_type: case DW_TAG_subroutine_type: + case DW_TAG_thrown_type: + case DW_TAG_typedef: case DW_TAG_union_type: - case DW_TAG_ptr_to_member_type: - case DW_TAG_set_type: - case DW_TAG_subrange_type: - case DW_TAG_base_type: - case DW_TAG_const_type: - case DW_TAG_file_type: - case DW_TAG_packed_type: + case DW_TAG_unspecified_type: case DW_TAG_volatile_type: - case DW_TAG_typedef: return true; default: return false; 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 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::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"