From 3739979c2031ebcf0ed40d30d549cf82bb1a122c Mon Sep 17 00:00:00 2001 From: David Stenberg Date: Wed, 10 Apr 2019 09:07:32 +0000 Subject: [DebugInfo] Make InstrRange into a class, NFC Summary: Replace use of std::pair by creating a class for the debug value instruction ranges instead. This is a preparatory refactoring for improving handling of clobbered fragments. In an upcoming commit the Begin pointer will become a PointerIntPair, so it will be cleaner to have a getter for that. Reviewers: aprantl Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59938 llvm-svn: 358059 --- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp') diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index a57f0f5..b91f40d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1159,8 +1159,8 @@ void CodeViewDebug::calculateRanges( // Calculate the definition ranges. for (auto I = Ranges.begin(), E = Ranges.end(); I != E; ++I) { - const InsnRange &Range = *I; - const MachineInstr *DVInst = Range.first; + const auto &Range = *I; + const MachineInstr *DVInst = Range.getBegin(); assert(DVInst->isDebugValue() && "Invalid History entry"); // FIXME: Find a way to represent constant variables, since they are // relatively common. @@ -1215,18 +1215,18 @@ void CodeViewDebug::calculateRanges( } // Compute the label range. - const MCSymbol *Begin = getLabelBeforeInsn(Range.first); - const MCSymbol *End = getLabelAfterInsn(Range.second); + const MCSymbol *Begin = getLabelBeforeInsn(Range.getBegin()); + const MCSymbol *End = getLabelAfterInsn(Range.getEnd()); if (!End) { // This range is valid until the next overlapping bitpiece. In the // common case, ranges will not be bitpieces, so they will overlap. auto J = std::next(I); const DIExpression *DIExpr = DVInst->getDebugExpression(); while (J != E && - !DIExpr->fragmentsOverlap(J->first->getDebugExpression())) + !DIExpr->fragmentsOverlap(J->getBegin()->getDebugExpression())) ++J; if (J != E) - End = getLabelBeforeInsn(J->first); + End = getLabelBeforeInsn(J->getBegin()); else End = Asm->getFunctionEnd(); } -- cgit v1.1