From 937c689cdcfa75960b294352e960250cb781fb04 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sat, 12 Apr 2014 05:35:59 +0000 Subject: PR13337: Omit DW_TAG_restrict_type when compiling for DWARF2 DWARF3 introduced DW_TAG_restrict_type, so avoid using it in prior versions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206105 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/DwarfUnit.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp index c1f0538e4c..7f6fd5d13c 100644 --- a/lib/CodeGen/AsmPrinter/DwarfUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfUnit.cpp @@ -985,6 +985,10 @@ DIE *DwarfUnit::getOrCreateTypeDIE(const MDNode *TyNode) { assert(Ty == resolve(Ty.getRef()) && "type was not uniqued, possible ODR violation."); + // DW_TAG_restrict_type is not supported in DWARF2 + if (Ty.getTag() == dwarf::DW_TAG_restrict_type && DD->getDwarfVersion() <= 2) + return getOrCreateTypeDIE(resolve(DIDerivedType(Ty).getTypeDerivedFrom())); + // Construct the context before querying for the existence of the DIE in case // such construction creates the DIE. DIScope Context = resolve(Ty.getContext()); -- cgit v1.2.3