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
This commit is contained in:
David Blaikie
2014-04-12 05:35:59 +00:00
parent 6a871a361d
commit 937c689cdc
2 changed files with 57 additions and 0 deletions

View File

@@ -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());