summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2014-08-11 21:05:57 +0000
committerAdrian Prantl <aprantl@apple.com>2014-08-11 21:05:57 +0000
commitcaaf053c79f1583f8034daa5ccc6ac3868af7f20 (patch)
treefeff22e9e340b6ade1be2f451ad21b02340cc6b5 /llvm/lib/CodeGen
parent293dd93f95c1e6c9965a10e5787dc31778bc31c7 (diff)
downloadbcm5719-llvm-caaf053c79f1583f8034daa5ccc6ac3868af7f20.tar.gz
bcm5719-llvm-caaf053c79f1583f8034daa5ccc6ac3868af7f20.zip
Debug info: Further simplify the implementation of buildLocationList by
getting rid of the redundant DIVariable in the OpenRanges pair. llvm-svn: 215385
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index b0ed22a5f4c..57dda88b002 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1233,8 +1233,7 @@ static bool piecesOverlap(DIVariable P1, DIVariable P2) {
void
DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
const DbgValueHistoryMap::InstrRanges &Ranges) {
- typedef std::pair<DIVariable, DebugLocEntry::Value> Range;
- SmallVector<Range, 4> OpenRanges;
+ SmallVector<DebugLocEntry::Value, 4> OpenRanges;
for (auto I = Ranges.begin(), E = Ranges.end(); I != E; ++I) {
const MachineInstr *Begin = I->first;
@@ -1251,9 +1250,10 @@ DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
// If this piece overlaps with any open ranges, truncate them.
DIVariable DIVar = Begin->getDebugVariable();
- auto Last = std::remove_if(OpenRanges.begin(), OpenRanges.end(), [&](Range R){
- return piecesOverlap(DIVar, R.first);
- });
+ auto Last = std::remove_if(OpenRanges.begin(), OpenRanges.end(),
+ [&](DebugLocEntry::Value R) {
+ return piecesOverlap(DIVar, DIVariable(R.getVariable()));
+ });
OpenRanges.erase(Last, OpenRanges.end());
const MCSymbol *StartLabel = getLabelBeforeInsn(Begin);
@@ -1277,7 +1277,7 @@ DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
// If this is a piece, it may belong to the current DebugLocEntry.
if (DIVar.isVariablePiece()) {
// Add this value to the list of open ranges.
- OpenRanges.push_back(std::make_pair(DIVar, Value));
+ OpenRanges.push_back(Value);
// Attempt to add the piece to the last entry.
if (!DebugLoc.empty())
OpenPOWER on IntegriCloud