summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-04-25 18:52:29 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-04-25 18:52:29 +0000
commitb0b3fcf6d36b56962b2d0b048487c45632b8a101 (patch)
treed90bb91e81851f8d6e807c79d8a12a9c2ef8e232 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
parentda5eaeda017a88613130a02d5ffac230bad94231 (diff)
downloadbcm5719-llvm-b0b3fcf6d36b56962b2d0b048487c45632b8a101.tar.gz
bcm5719-llvm-b0b3fcf6d36b56962b2d0b048487c45632b8a101.zip
DwarfUnit: return by reference from createAndAddDIE
Since this doesn't return ownership (the DIE has been added to the specified parent already) nor return null, just return by reference. llvm-svn: 207259
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index a8936bad2be..321b6c03bac 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -272,7 +272,7 @@ static bool SectionSort(const MCSection *A, const MCSection *B) {
// TODO: Determine whether or not we should add names for programs
// that do not have a DW_AT_name or DW_AT_linkage_name field - this
// is only slightly different than the lookup of non-standard ObjC names.
-void DwarfDebug::addSubprogramNames(DISubprogram SP, DIE *Die) {
+void DwarfDebug::addSubprogramNames(DISubprogram SP, DIE &Die) {
if (!SP.isDefinition())
return;
addAccelName(SP.getName(), Die);
@@ -322,7 +322,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
// concrete DIE twice.
if (DIE *AbsSPDIE = AbstractSPDies.lookup(SP)) {
// Pick up abstract subprogram DIE.
- SPDie = SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie());
+ SPDie = &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie());
SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_abstract_origin, AbsSPDIE);
} else {
DISubprogram SPDecl = SP.getFunctionDeclaration();
@@ -345,7 +345,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
SPCU.constructSubprogramArguments(*SPDie, Args);
DIE *SPDeclDie = SPDie;
SPDie =
- SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie());
+ &SPCU.createAndAddDIE(dwarf::DW_TAG_subprogram, SPCU.getUnitDie());
SPCU.addDIEEntry(*SPDie, dwarf::DW_AT_specification, SPDeclDie);
}
}
@@ -359,7 +359,7 @@ DIE *DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
// Add name to the name table, we do this here because we're guaranteed
// to have concrete versions of our DW_TAG_subprogram nodes.
- addSubprogramNames(SP, SPDie);
+ addSubprogramNames(SP, *SPDie);
return SPDie;
}
@@ -501,7 +501,7 @@ DIE *DwarfDebug::constructInlinedScopeDIE(DwarfCompileUnit &TheCU,
// Add name to the name table, we do this here because we're guaranteed
// to have concrete versions of our DW_TAG_inlined_subprogram nodes.
- addSubprogramNames(InlinedSP, ScopeDIE);
+ addSubprogramNames(InlinedSP, *ScopeDIE);
return ScopeDIE;
}
@@ -734,7 +734,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 = *TheCU.createAndAddDIE(Module.getTag(), *Context, Module);
+ DIE &IMDie = TheCU.createAndAddDIE(Module.getTag(), *Context, Module);
DIE *EntityDie;
DIDescriptor Entity = resolve(Module.getEntity());
if (Entity.isNameSpace())
@@ -2541,30 +2541,30 @@ void DwarfDebug::attachLowHighPC(DwarfCompileUnit &Unit, DIE &D,
// DIE to the proper table while ensuring that the name that we're going
// to reference is in the string table. We do this since the names we
// add may not only be identical to the names in the DIE.
-void DwarfDebug::addAccelName(StringRef Name, const DIE *Die) {
+void DwarfDebug::addAccelName(StringRef Name, const DIE &Die) {
if (!useDwarfAccelTables())
return;
InfoHolder.getStringPoolEntry(Name);
- AccelNames.AddName(Name, Die);
+ AccelNames.AddName(Name, &Die);
}
-void DwarfDebug::addAccelObjC(StringRef Name, const DIE *Die) {
+void DwarfDebug::addAccelObjC(StringRef Name, const DIE &Die) {
if (!useDwarfAccelTables())
return;
InfoHolder.getStringPoolEntry(Name);
- AccelObjC.AddName(Name, Die);
+ AccelObjC.AddName(Name, &Die);
}
-void DwarfDebug::addAccelNamespace(StringRef Name, const DIE *Die) {
+void DwarfDebug::addAccelNamespace(StringRef Name, const DIE &Die) {
if (!useDwarfAccelTables())
return;
InfoHolder.getStringPoolEntry(Name);
- AccelNamespace.AddName(Name, Die);
+ AccelNamespace.AddName(Name, &Die);
}
-void DwarfDebug::addAccelType(StringRef Name, const DIE *Die, char Flags) {
+void DwarfDebug::addAccelType(StringRef Name, const DIE &Die, char Flags) {
if (!useDwarfAccelTables())
return;
InfoHolder.getStringPoolEntry(Name);
- AccelTypes.AddName(Name, Die, Flags);
+ AccelTypes.AddName(Name, &Die, Flags);
}
OpenPOWER on IntegriCloud