aboutsummaryrefslogtreecommitdiffstats
path: root/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-07-23 23:10:00 +0000
committerManman Ren <manman.ren@gmail.com>2013-07-23 23:10:00 +0000
commit7894ffd006bfabd45c75696c9b7cfdda7c7bad9d (patch)
tree58606fa9c3bf49fee8c682a58aaef2cb04db916b /lib/IR/DebugInfo.cpp
parent4f2c29708d3208197f706f6e8841a2f828aea89c (diff)
downloadexternal_llvm-7894ffd006bfabd45c75696c9b7cfdda7c7bad9d.zip
external_llvm-7894ffd006bfabd45c75696c9b7cfdda7c7bad9d.tar.gz
external_llvm-7894ffd006bfabd45c75696c9b7cfdda7c7bad9d.tar.bz2
Debug Info: improve the Finder.
Improve the Finder to handle context of a DIVariable. If Scope is a DICompileUnit, add it to the list of CUs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DebugInfo.cpp')
-rw-r--r--lib/IR/DebugInfo.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp
index 0fbfd2d..b611f45 100644
--- a/lib/IR/DebugInfo.cpp
+++ b/lib/IR/DebugInfo.cpp
@@ -908,6 +908,14 @@ void DebugInfoFinder::processScope(DIScope Scope) {
processType(Ty);
return;
}
+ if (Scope.isCompileUnit()) {
+ addCompileUnit(DICompileUnit(Scope));
+ return;
+ }
+ if (Scope.isSubprogram()) {
+ processSubprogram(DISubprogram(Scope));
+ return;
+ }
if (!addScope(Scope))
return;
if (Scope.isLexicalBlock()) {
@@ -954,6 +962,7 @@ void DebugInfoFinder::processDeclare(const DbgDeclareInst *DDI) {
if (!NodesSeen.insert(DV))
return;
+ processScope(DIVariable(N).getContext());
processType(DIVariable(N).getType());
}