1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00

Add utility routine to collect variable debug info. This is not yet used.

llvm-svn: 83355
This commit is contained in:
Devang Patel 2009-10-06 01:26:37 +00:00
parent 4b011e6a51
commit ac511d1acf
2 changed files with 17 additions and 0 deletions

View File

@ -1782,6 +1782,20 @@ void DwarfDebug::EndModule() {
DebugTimer->stopTimer();
}
/// CollectVariableInfo - Populate DbgScope entries with variables' info.
void DwarfDebug::CollectVariableInfo() {
if (!MMI) return;
MachineModuleInfo::VariableDbgInfoMapTy &VMap = MMI->getVariableDbgInfo();
for (MachineModuleInfo::VariableDbgInfoMapTy::iterator VI = VMap.begin(),
VE = VMap.end(); VI != VE; ++VI) {
MDNode *Var = VI->first;
DILocation VLoc(VI->second.first);
unsigned VSlot = VI->second.second;
DbgScope *Scope = getDbgScope(VLoc.getScope().getNode(), NULL);
Scope->AddVariable(new DbgVariable(DIVariable(Var), VSlot, false));
}
}
/// ExtractScopeInformation - Scan machine instructions in this function
/// and collect DbgScopes. Return true, if atleast one scope was found.
bool DwarfDebug::ExtractScopeInformation(MachineFunction *MF) {

View File

@ -560,6 +560,9 @@ public:
/// and collect DbgScopes. Return true, if atleast one scope was found.
bool ExtractScopeInformation(MachineFunction *MF);
/// CollectVariableInfo - Populate DbgScope entries with variables' info.
void CollectVariableInfo();
void SetDbgScopeLabels(const MachineInstr *MI, unsigned Label);
};