Process DbgDeclareInst.

llvm-svn: 77694
This commit is contained in:
Devang Patel 2009-07-31 18:18:52 +00:00
parent 40f830d08c
commit 9d7de2a155
2 changed files with 18 additions and 0 deletions

View File

@ -638,6 +638,9 @@ namespace llvm {
/// processRegionEnd - Process DbgRegionEnd.
void processRegionEnd(DbgRegionEndInst *DRE);
/// processDeclare - Process DbgDeclareInst.
void processDeclare(DbgDeclareInst *DDI);
/// addCompileUnit - Add compile unit into CUs.
bool addCompileUnit(DICompileUnit CU);

View File

@ -924,6 +924,8 @@ void DebugInfoFinder::processModule(Module &M) {
processRegionStart(DRS);
else if (DbgRegionEndInst *DRE = dyn_cast<DbgRegionEndInst>(BI))
processRegionEnd(DRE);
else if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI))
processDeclare(DDI);
}
for (Module::global_iterator GVI = M.global_begin(), GVE = M.global_end();
@ -1003,6 +1005,19 @@ void DebugInfoFinder::processRegionEnd(DbgRegionEndInst *DRE) {
processSubprogram(DISubprogram(SP));
}
/// processDeclare - Process DbgDeclareInst.
void DebugInfoFinder::processDeclare(DbgDeclareInst *DDI) {
DIVariable DV(cast<GlobalVariable>(DDI->getVariable()));
if (DV.isNull())
return;
if (!NodesSeen.insert(DV.getGV()))
return;
addCompileUnit(DV.getCompileUnit());
processType(DV.getType());
}
/// addCompileUnit - Add compile unit into CUs.
bool DebugInfoFinder::addCompileUnit(DICompileUnit CU) {
if (CU.isNull())