Use dwarf::Tag rather than unsigned for DIE::Tag to make debugging easier.

Nice to be able to just print out the Tag and have the debugger print
dwarf::DW_TAG_subprogram or whatever, rather than an int.

It's a bit finicky (for example DIDescriptor::getTag still returns
unsigned) because some places still handle real dwarf tags + our fake
tags (one day we'll remove the fake tags, hopefully).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206098 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie
2014-04-12 02:24:04 +00:00
parent ac871732b5
commit 9c9ef05445
4 changed files with 13 additions and 8 deletions

View File

@ -791,8 +791,7 @@ void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit *TheCU,
assert(Module.Verify() &&
"Use one of the MDNode * overloads to handle invalid metadata");
assert(Context && "Should always have a context for an imported_module");
DIE *IMDie = new DIE(Module.getTag());
TheCU->insertDIE(Module, IMDie);
DIE *IMDie = TheCU->createAndAddDIE(Module.getTag(), *Context, Module);
DIE *EntityDie;
DIDescriptor Entity = resolve(Module.getEntity());
if (Entity.isNameSpace())
@ -810,7 +809,6 @@ void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit *TheCU,
StringRef Name = Module.getName();
if (!Name.empty())
TheCU->addString(IMDie, dwarf::DW_AT_name, Name);
Context->addChild(IMDie);
}
// Emit all Dwarf sections that should come prior to the content. Create