summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-10-04 15:58:47 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-10-04 15:58:47 +0000
commit14499a7d68a7e7e5d2715f04265669d6fa80eff7 (patch)
treeb7e837b9dd1495898ba577faa111d600adc4ee78 /llvm/lib
parent37c5231051c03ef91c4873edaad102b4d2042433 (diff)
downloadbcm5719-llvm-14499a7d68a7e7e5d2715f04265669d6fa80eff7.tar.gz
bcm5719-llvm-14499a7d68a7e7e5d2715f04265669d6fa80eff7.zip
Sink DwarfDebug::attachLowHighPC into DwarfCompileUnit
One of many things to sink down into DwarfCompileUnit to allow handling of subprograms in both the skeleton and dwo CU under Fission. llvm-svn: 219058
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp14
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h2
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp22
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h2
4 files changed, 20 insertions, 20 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
index b7a56e32513..4184a0f021a 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
@@ -274,4 +274,18 @@ void DwarfCompileUnit::applyStmtList(DIE &D) {
UnitDie.getValues()[stmtListIndex]);
}
+void DwarfCompileUnit::attachLowHighPC(DIE &D, const MCSymbol *Begin,
+ const MCSymbol *End) {
+ assert(Begin && "Begin label should not be null!");
+ assert(End && "End label should not be null!");
+ assert(Begin->isDefined() && "Invalid starting label");
+ assert(End->isDefined() && "Invalid end label");
+
+ addLabelAddress(D, dwarf::DW_AT_low_pc, Begin);
+ if (DD->getDwarfVersion() < 4)
+ addLabelAddress(D, dwarf::DW_AT_high_pc, End);
+ else
+ addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin);
+}
+
} // end llvm namespace
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
index bced5335e28..85fa6c0b5b8 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h
@@ -60,6 +60,8 @@ public:
/// addRange - Add an address range to the list of ranges for this unit.
void addRange(RangeSpan Range);
+
+ void attachLowHighPC(DIE &D, const MCSymbol *Begin, const MCSymbol *End);
};
} // end llvm namespace
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index a19750a4904..5f2d15e257e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -318,7 +318,7 @@ DIE &DwarfDebug::updateSubprogramScopeDIE(DwarfCompileUnit &SPCU,
DISubprogram SP) {
DIE *SPDie = SPCU.getOrCreateSubprogramDIE(SP);
- attachLowHighPC(SPCU, *SPDie, FunctionBeginSym, FunctionEndSym);
+ SPCU.attachLowHighPC(*SPDie, FunctionBeginSym, FunctionEndSym);
if (!CurFn->getTarget().Options.DisableFramePointerElim(*CurFn))
SPCU.addFlag(*SPDie, dwarf::DW_AT_APPLE_omit_frame_ptr);
@@ -394,8 +394,8 @@ void DwarfDebug::attachRangesOrLowHighPC(DwarfCompileUnit &TheCU, DIE &Die,
const SmallVectorImpl<InsnRange> &Ranges) {
assert(!Ranges.empty());
if (Ranges.size() == 1)
- attachLowHighPC(TheCU, Die, getLabelBeforeInsn(Ranges.front().first),
- getLabelAfterInsn(Ranges.front().second));
+ TheCU.attachLowHighPC(Die, getLabelBeforeInsn(Ranges.front().first),
+ getLabelAfterInsn(Ranges.front().second));
else
addScopeRangeList(TheCU, Die, Ranges);
}
@@ -977,7 +977,7 @@ void DwarfDebug::finalizeModuleInfo() {
0);
} else {
RangeSpan &Range = TheU->getRanges().back();
- attachLowHighPC(U, U.getUnitDie(), Range.getStart(), Range.getEnd());
+ U.attachLowHighPC(U.getUnitDie(), Range.getStart(), Range.getEnd());
}
}
}
@@ -2636,20 +2636,6 @@ void DwarfDebug::addDwarfTypeUnitType(DwarfCompileUnit &CU,
CU.addDIETypeSignature(RefDie, NewTU);
}
-void DwarfDebug::attachLowHighPC(DwarfCompileUnit &Unit, DIE &D,
- const MCSymbol *Begin, const MCSymbol *End) {
- assert(Begin && "Begin label should not be null!");
- assert(End && "End label should not be null!");
- assert(Begin->isDefined() && "Invalid starting label");
- assert(End->isDefined() && "Invalid end label");
-
- Unit.addLabelAddress(D, dwarf::DW_AT_low_pc, Begin);
- if (DwarfVersion < 4)
- Unit.addLabelAddress(D, dwarf::DW_AT_high_pc, End);
- else
- Unit.addLabelDelta(D, dwarf::DW_AT_high_pc, End, Begin);
-}
-
// Accelerator table mutators - add each name along with its companion
// 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
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
index 1432ecd58ae..92c558e17f5 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h
@@ -567,8 +567,6 @@ class DwarfDebug : public AsmPrinterHandler {
void attachRangesOrLowHighPC(DwarfCompileUnit &Unit, DIE &D,
const SmallVectorImpl<InsnRange> &Ranges);
- void attachLowHighPC(DwarfCompileUnit &Unit, DIE &D, const MCSymbol *Begin,
- const MCSymbol *End);
public:
//===--------------------------------------------------------------------===//
OpenPOWER on IntegriCloud