summaryrefslogtreecommitdiff
path: root/lib/Analysis
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
commitb4d31306a4f9e84a7ab6ace99964634adb4bf7e6 (patch)
tree7d4ddc9d97af78b5719d3c57a64354df3439dae3 /lib/Analysis
parentfb3af88ba75898896714d49c608b8daa4f106636 (diff)
downloadllvm-b4d31306a4f9e84a7ab6ace99964634adb4bf7e6.tar.gz
llvm-b4d31306a4f9e84a7ab6ace99964634adb4bf7e6.tar.bz2
llvm-b4d31306a4f9e84a7ab6ace99964634adb4bf7e6.tar.xz
Process DbgDeclareInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77694 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/DebugInfo.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 1899623287..5ecfdcdd44 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/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())