diff options
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/IR/DebugInfo.cpp | 18 | ||||
-rw-r--r-- | llvm/lib/IR/Verifier.cpp | 5 |
2 files changed, 16 insertions, 7 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp index 146f11350fd..e8334f5374e 100644 --- a/llvm/lib/IR/DebugInfo.cpp +++ b/llvm/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()); } diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index 0eda97f1289..d523e42823f 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -2096,11 +2096,6 @@ void Verifier::visitInstruction(Instruction &I) { MDNode *MD = I.getMetadata(LLVMContext::MD_range); Assert1(!MD || isa<LoadInst>(I), "Ranges are only for loads!", &I); - if (!DisableDebugInfoVerifier) { - MD = I.getMetadata(LLVMContext::MD_dbg); - Finder.processLocation(DILocation(MD)); - } - InstsInThisBlock.insert(&I); } |