diff options
Diffstat (limited to 'lib/IR/DebugInfo.cpp')
-rw-r--r-- | lib/IR/DebugInfo.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp index 146f11350f..e8334f5374 100644 --- a/lib/IR/DebugInfo.cpp +++ b/lib/IR/DebugInfo.cpp @@ -908,12 +908,26 @@ void DebugInfoFinder::processModule(const Module &M) { return; } } + if (NamedMDNode *SP_Nodes = M.getNamedMetadata("llvm.dbg.sp")) { + for (unsigned i = 0, e = SP_Nodes->getNumOperands(); i != e; ++i) + processSubprogram(DISubprogram(SP_Nodes->getOperand(i))); + } } /// processLocation - Process DILocation. void DebugInfoFinder::processLocation(DILocation Loc) { - if (!Loc) return; - processScope(Loc.getScope()); + if (!Loc.Verify()) return; + DIDescriptor S(Loc.getScope()); + if (S.isCompileUnit()) + addCompileUnit(DICompileUnit(S)); + else if (S.isSubprogram()) + processSubprogram(DISubprogram(S)); + else if (S.isLexicalBlock()) + processLexicalBlock(DILexicalBlock(S)); + else if (S.isLexicalBlockFile()) { + DILexicalBlockFile DBF = DILexicalBlockFile(S); + processLexicalBlock(DILexicalBlock(DBF.getScope())); + } processLocation(Loc.getOrigLocation()); } |