DebugInfo: Use common line/file attribute construction code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203676 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Blaikie 2014-03-12 16:51:06 +00:00
parent 4c871b7880
commit a3802ac246

View File

@ -838,11 +838,9 @@ void DwarfDebug::constructImportedEntityDIE(DwarfCompileUnit *TheCU,
EntityDie = TheCU->getOrCreateTypeDIE(DIType(Entity));
else
EntityDie = TheCU->getDIE(Entity);
unsigned FileID = getOrCreateSourceID(Module.getContext().getFilename(),
Module.getContext().getDirectory(),
TheCU->getUniqueID());
TheCU->addUInt(IMDie, dwarf::DW_AT_decl_file, None, FileID);
TheCU->addUInt(IMDie, dwarf::DW_AT_decl_line, None, Module.getLineNumber());
TheCU->addSourceLine(IMDie, Module.getLineNumber(),
Module.getContext().getFilename(),
Module.getContext().getDirectory());
TheCU->addDIEEntry(IMDie, dwarf::DW_AT_import, EntityDie);
StringRef Name = Module.getName();
if (!Name.empty())