summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-03-09 15:44:39 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-03-09 15:44:39 +0000
commit2abfd6c73421b1bec696c812de1f36cf17e75d16 (patch)
tree484b05f23f912eafe9e360a5996272e672803571 /llvm/lib/CodeGen
parent79da941f3ac36356feaacbc96846f914d5838df8 (diff)
downloadbcm5719-llvm-2abfd6c73421b1bec696c812de1f36cf17e75d16.tar.gz
bcm5719-llvm-2abfd6c73421b1bec696c812de1f36cf17e75d16.zip
MachineModuleInfo: Turn nested std::pairs into a proper struct.
llvm-svn: 203414
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp17
-rw-r--r--llvm/lib/CodeGen/MachineModuleInfo.cpp2
-rw-r--r--llvm/lib/CodeGen/StackColoring.cpp15
3 files changed, 14 insertions, 20 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index a1fea4f9750..5c17417c51e 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1185,26 +1185,23 @@ bool DwarfDebug::addCurrentFnArgument(DbgVariable *Var, LexicalScope *Scope) {
void DwarfDebug::collectVariableInfoFromMMITable(
SmallPtrSet<const MDNode *, 16> &Processed) {
for (const auto &VI : MMI->getVariableDbgInfo()) {
- const MDNode *Var = VI.first;
- if (!Var)
+ if (!VI.Var)
continue;
- Processed.insert(Var);
- DIVariable DV(Var);
- const std::pair<unsigned, DebugLoc> &VP = VI.second;
-
- LexicalScope *Scope = LScopes.findLexicalScope(VP.second);
+ Processed.insert(VI.Var);
+ DIVariable DV(VI.Var);
+ LexicalScope *Scope = LScopes.findLexicalScope(VI.Loc);
// If variable scope is not found then skip this variable.
if (Scope == 0)
continue;
- DbgVariable *AbsDbgVariable = findAbstractVariable(DV, VP.second);
+ DbgVariable *AbsDbgVariable = findAbstractVariable(DV, VI.Loc);
DbgVariable *RegVar = new DbgVariable(DV, AbsDbgVariable, this);
- RegVar->setFrameIndex(VP.first);
+ RegVar->setFrameIndex(VI.Slot);
if (!addCurrentFnArgument(RegVar, Scope))
addScopeVariable(Scope, RegVar);
if (AbsDbgVariable)
- AbsDbgVariable->setFrameIndex(VP.first);
+ AbsDbgVariable->setFrameIndex(VI.Slot);
}
}
diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp
index d0ff1e70699..71810255845 100644
--- a/llvm/lib/CodeGen/MachineModuleInfo.cpp
+++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp
@@ -313,7 +313,7 @@ void MachineModuleInfo::EndFunction() {
CallsEHReturn = 0;
CallsUnwindInit = 0;
CompactUnwindEncoding = 0;
- VariableDbgInfo.clear();
+ VariableDbgInfos.clear();
}
/// AnalyzeModule - Scan the module for global debug information.
diff --git a/llvm/lib/CodeGen/StackColoring.cpp b/llvm/lib/CodeGen/StackColoring.cpp
index 6ef0ab8a0cd..a1f7a126754 100644
--- a/llvm/lib/CodeGen/StackColoring.cpp
+++ b/llvm/lib/CodeGen/StackColoring.cpp
@@ -473,15 +473,12 @@ void StackColoring::remapInstructions(DenseMap<int, int> &SlotRemap) {
MachineModuleInfo *MMI = &MF->getMMI();
// Remap debug information that refers to stack slots.
- MachineModuleInfo::VariableDbgInfoMapTy &VMap = MMI->getVariableDbgInfo();
- for (MachineModuleInfo::VariableDbgInfoMapTy::iterator VI = VMap.begin(),
- VE = VMap.end(); VI != VE; ++VI) {
- const MDNode *Var = VI->first;
- if (!Var) continue;
- std::pair<unsigned, DebugLoc> &VP = VI->second;
- if (SlotRemap.count(VP.first)) {
- DEBUG(dbgs()<<"Remapping debug info for ["<<Var->getName()<<"].\n");
- VP.first = SlotRemap[VP.first];
+ for (auto &VI : MMI->getVariableDbgInfo()) {
+ if (!VI.Var)
+ continue;
+ if (SlotRemap.count(VI.Slot)) {
+ DEBUG(dbgs()<<"Remapping debug info for ["<<VI.Var->getName()<<"].\n");
+ VI.Slot = SlotRemap[VI.Slot];
FixedDbg++;
}
}
OpenPOWER on IntegriCloud