summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b89cf2a)
raw | patch | inline | side by side (parent: b89cf2a)
author | Adrian Prantl <aprantl@apple.com> | |
Mon, 11 Aug 2014 21:05:57 +0000 (21:05 +0000) | ||
committer | Adrian Prantl <aprantl@apple.com> | |
Mon, 11 Aug 2014 21:05:57 +0000 (21:05 +0000) |
getting rid of the redundant DIVariable in the OpenRanges pair.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215385 91177308-0d34-0410-b5e6-96231b3b80d8
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215385 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/AsmPrinter/DwarfDebug.cpp | patch | blob | history |
index b0ed22a5f4c6fc7c998d5a640d08374cfc6ee167..57dda88b0021b11a1602cf651f6a045bde5ac0dd 100644 (file)
void
DwarfDebug::buildLocationList(SmallVectorImpl<DebugLocEntry> &DebugLoc,
const DbgValueHistoryMap::InstrRanges &Ranges) {
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;
for (auto I = Ranges.begin(), E = Ranges.end(); I != E; ++I) {
const MachineInstr *Begin = I->first;
// If this piece overlaps with any open ranges, truncate them.
DIVariable DIVar = Begin->getDebugVariable();
// 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);
OpenRanges.erase(Last, OpenRanges.end());
const MCSymbol *StartLabel = getLabelBeforeInsn(Begin);
// If this is a piece, it may belong to the current DebugLocEntry.
if (DIVar.isVariablePiece()) {
// Add this value to the list of open ranges.
// 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())
// Attempt to add the piece to the last entry.
if (!DebugLoc.empty())