summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-07-31 18:18:52 +0000
committerDevang Patel <dpatel@apple.com>2009-07-31 18:18:52 +0000
commit9d7de2a155ec21368b259ddebc4f68609faeab6e (patch)
tree6a54f9f812ca6c964596d0fed694fc13d49e2756
parent40f830d08c75c5e188fff582839e25d84af4a2ef (diff)
downloadbcm5719-llvm-9d7de2a155ec21368b259ddebc4f68609faeab6e.tar.gz
bcm5719-llvm-9d7de2a155ec21368b259ddebc4f68609faeab6e.zip
Process DbgDeclareInst.
llvm-svn: 77694
-rw-r--r--llvm/include/llvm/Analysis/DebugInfo.h3
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp15
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/DebugInfo.h b/llvm/include/llvm/Analysis/DebugInfo.h
index f35bbc14d4e..5e24a57cfe6 100644
--- a/llvm/include/llvm/Analysis/DebugInfo.h
+++ b/llvm/include/llvm/Analysis/DebugInfo.h
@@ -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);
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index 18996232870..5ecfdcdd449 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -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())
OpenPOWER on IntegriCloud