summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/DebugInfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/DebugInfo.cpp')
-rw-r--r--llvm/lib/IR/DebugInfo.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/llvm/lib/IR/DebugInfo.cpp b/llvm/lib/IR/DebugInfo.cpp
index 4fe2553687c..c5d39c54430 100644
--- a/llvm/lib/IR/DebugInfo.cpp
+++ b/llvm/lib/IR/DebugInfo.cpp
@@ -79,9 +79,19 @@ void DebugInfoFinder::processModule(const Module &M) {
processScope(M->getScope());
}
}
- for (auto &F : M.functions())
+ for (auto &F : M.functions()) {
if (auto *SP = cast_or_null<DISubprogram>(F.getSubprogram()))
processSubprogram(SP);
+ // There could be subprograms from inlined functions referenced from
+ // instructions only. Walk the function to find them.
+ for (const BasicBlock &BB : F) {
+ for (const Instruction &I : BB) {
+ if (!I.getDebugLoc())
+ continue;
+ processLocation(M, I.getDebugLoc().get());
+ }
+ }
+ }
}
void DebugInfoFinder::processLocation(const Module &M, const DILocation *Loc) {
OpenPOWER on IntegriCloud