summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp27
1 files changed, 2 insertions, 25 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
index 2e5c2244793..edf66e93058 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DebugHandlerBase.cpp
@@ -123,29 +123,6 @@ MCSymbol *DebugHandlerBase::getLabelAfterInsn(const MachineInstr *MI) {
return LabelsAfterInsn.lookup(MI);
}
-int DebugHandlerBase::fragmentCmp(const DIExpression *P1,
- const DIExpression *P2) {
- auto Fragment1 = *P1->getFragmentInfo();
- auto Fragment2 = *P2->getFragmentInfo();
- unsigned l1 = Fragment1.OffsetInBits;
- unsigned l2 = Fragment2.OffsetInBits;
- unsigned r1 = l1 + Fragment1.SizeInBits;
- unsigned r2 = l2 + Fragment2.SizeInBits;
- if (r1 <= l2)
- return -1;
- else if (r2 <= l1)
- return 1;
- else
- return 0;
-}
-
-bool DebugHandlerBase::fragmentsOverlap(const DIExpression *P1,
- const DIExpression *P2) {
- if (!P1->isFragment() || !P2->isFragment())
- return true;
- return fragmentCmp(P1, P2) == 0;
-}
-
/// If this type is derived from a base type then return base type size.
uint64_t DebugHandlerBase::getBaseTypeSize(const DITypeRef TyRef) {
DIType *Ty = TyRef.resolve();
@@ -232,8 +209,8 @@ void DebugHandlerBase::beginFunction(const MachineFunction *MF) {
const DIExpression *Fragment = I->first->getDebugExpression();
if (std::all_of(Ranges.begin(), I,
[&](DbgValueHistoryMap::InstrRange Pred) {
- return !fragmentsOverlap(
- Fragment, Pred.first->getDebugExpression());
+ return !Fragment->fragmentsOverlap(
+ Pred.first->getDebugExpression());
}))
LabelsBeforeInsn[I->first] = Asm->getFunctionBegin();
else
OpenPOWER on IntegriCloud