summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-11-02 06:06:14 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-11-02 06:06:14 +0000
commit98cf172175690da1593ada13d8835ec5898d76ba (patch)
treea3ace0b4172ac57b86e5637e1f370b66a26dbf49 /llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
parentcd2996c3e36a05c8200de1f5c23b406f6ed83246 (diff)
downloadbcm5719-llvm-98cf172175690da1593ada13d8835ec5898d76ba.tar.gz
bcm5719-llvm-98cf172175690da1593ada13d8835ec5898d76ba.zip
Add DwarfUnit::addGlobalType to match DwarfUnit::addGlobalName
(these will shortly become virtual, with a null implementation in DwarfUnit (since type units don't have accelerator tables in the current schema) and the current implementation down in DwarfCompileUnit, moving the actual maps there too) llvm-svn: 221082
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
index c49edd8daca..e523bb007bb 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
@@ -976,11 +976,9 @@ void DwarfUnit::updateAcceleratorTables(DIScope Context, DIType Ty,
unsigned Flags = IsImplementation ? dwarf::DW_FLAG_type_implementation : 0;
DD->addAccelType(Ty.getName(), TyDIE, Flags);
- if ((!Context || Context.isCompileUnit() || Context.isFile() ||
- Context.isNameSpace()) &&
- getCUNode().getEmissionKind() != DIBuilder::LineTablesOnly)
- GlobalTypes[getParentContextString(Context) + Ty.getName().str()] =
- &TyDIE;
+ if (!Context || Context.isCompileUnit() || Context.isFile() ||
+ Context.isNameSpace())
+ addGlobalType(Ty, TyDIE, Context);
}
}
@@ -1013,6 +1011,14 @@ void DwarfUnit::addGlobalName(StringRef Name, DIE &Die, DIScope Context) {
GlobalNames[FullName] = &Die;
}
+/// Add a new global type to the unit.
+void DwarfUnit::addGlobalType(DIType Ty, const DIE &Die, DIScope Context) {
+ if (getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly)
+ return;
+ std::string FullName = getParentContextString(Context) + Ty.getName().str();
+ GlobalTypes[FullName] = &Die;
+}
+
/// getParentContextString - Walks the metadata parent chain in a language
/// specific manner (using the compile unit language) and returns
/// it as a string. This is done at the metadata level because DIEs may
OpenPOWER on IntegriCloud