[llvm-commits] [llvm] r77694 - in /llvm/trunk: include/llvm/Analysis/DebugInfo.h lib/Analysis/DebugInfo.cpp
Devang Patel
dpatel at apple.com
Fri Jul 31 11:18:52 PDT 2009
Author: dpatel
Date: Fri Jul 31 13:18:52 2009
New Revision: 77694
URL: http://llvm.org/viewvc/llvm-project?rev=77694&view=rev
Log:
Process DbgDeclareInst.
Modified:
llvm/trunk/include/llvm/Analysis/DebugInfo.h
llvm/trunk/lib/Analysis/DebugInfo.cpp
Modified: llvm/trunk/include/llvm/Analysis/DebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DebugInfo.h?rev=77694&r1=77693&r2=77694&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DebugInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/DebugInfo.h Fri Jul 31 13:18:52 2009
@@ -638,6 +638,9 @@
/// processRegionEnd - Process DbgRegionEnd.
void processRegionEnd(DbgRegionEndInst *DRE);
+ /// processDeclare - Process DbgDeclareInst.
+ void processDeclare(DbgDeclareInst *DDI);
+
/// addCompileUnit - Add compile unit into CUs.
bool addCompileUnit(DICompileUnit CU);
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=77694&r1=77693&r2=77694&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Fri Jul 31 13:18:52 2009
@@ -924,6 +924,8 @@
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 @@
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())
More information about the llvm-commits
mailing list