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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83355 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel 2009-10-06 01:26:37 +00:00
parent ea5ed00ea3
commit e717faa467
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);
};