summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-07-22 20:28:53 +0000
committerManman Ren <manman.ren@gmail.com>2013-07-22 20:28:53 +0000
commit14dd2a656e0b65553a82026f181b73a3f479d20d (patch)
tree3f480b52708dc6ebdbd8a1930d236392992ae9b9 /llvm/lib/IR
parent55b0be72d11ce678df24d8971d5553415a0edd61 (diff)
downloadbcm5719-llvm-14dd2a656e0b65553a82026f181b73a3f479d20d.tar.gz
bcm5719-llvm-14dd2a656e0b65553a82026f181b73a3f479d20d.zip
Debug Info Finder: add processScope to actually handle the Scope.
Instead of just adding the scope to the list, we actually handle the scope. llvm-svn: 186867
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp26
1 files changed, 23 insertions, 3 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index f6ffc039dcb..f63fa1a22d0 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -857,7 +857,7 @@ void DebugInfoFinder::processModule(const Module &M) {
for (unsigned i = 0, e = GVs.getNumElements(); i != e; ++i) {
DIGlobalVariable DIG(GVs.getElement(i));
if (addGlobalVariable(DIG)) {
- addScope(DIG.getContext());
+ processScope(DIG.getContext());
processType(DIG.getType());
}
}
@@ -897,7 +897,7 @@ void DebugInfoFinder::processLocation(DILocation Loc) {
void DebugInfoFinder::processType(DIType DT) {
if (!addType(DT))
return;
- addScope(DT.getContext());
+ processScope(DT.getContext());
if (DT.isCompositeType()) {
DICompositeType DCT(DT);
processType(DCT.getTypeDerivedFrom());
@@ -915,6 +915,26 @@ void DebugInfoFinder::processType(DIType DT) {
}
}
+void DebugInfoFinder::processScope(DIScope Scope) {
+ if (Scope.isType()) {
+ DIType Ty(Scope);
+ processType(Ty);
+ return;
+ }
+ if (!addScope(Scope))
+ return;
+ if (Scope.isLexicalBlock()) {
+ DILexicalBlock LB(Scope);
+ processScope(LB.getContext());
+ } else if (Scope.isLexicalBlockFile()) {
+ DILexicalBlockFile LBF = DILexicalBlockFile(Scope);
+ processScope(LBF.getScope());
+ } else if (Scope.isNameSpace()) {
+ DINameSpace NS(Scope);
+ processScope(NS.getContext());
+ }
+}
+
/// processLexicalBlock
void DebugInfoFinder::processLexicalBlock(DILexicalBlock LB) {
DIScope Context = LB.getContext();
@@ -932,7 +952,7 @@ void DebugInfoFinder::processLexicalBlock(DILexicalBlock LB) {
void DebugInfoFinder::processSubprogram(DISubprogram SP) {
if (!addSubprogram(SP))
return;
- addScope(SP.getContext());
+ processScope(SP.getContext());
processType(SP.getType());
}
OpenPOWER on IntegriCloud