summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 30f3715b08e..f8dd0823902 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -2579,6 +2579,15 @@ void Verifier::verifyCallSite(CallSite CS) {
}
}
+ // Verify that each inlinable callsite of a debug-info-bearing function in a
+ // debug-info-bearing function has a debug location attached to it. Failure to
+ // do so causes assertion failures when the inliner sets up inline scope info.
+ if (I->getFunction()->getSubprogram() && CS.getCalledFunction() &&
+ CS.getCalledFunction()->getSubprogram())
+ Assert(I->getDebugLoc(), "inlinable function call in a function with debug "
+ "info must have a !dbg location",
+ I);
+
visitInstruction(*I);
}
OpenPOWER on IntegriCloud