summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-04-24 03:23:02 +0000
committerAdrian Prantl <aprantl@apple.com>2016-04-24 03:23:02 +0000
commit971481db982d36338cbb2c096e98576dc5de2edc (patch)
tree744a090c6c0bf1475c4d068a36f9575028eeadc1 /llvm/lib/IR/Verifier.cpp
parentc3ed48c1bdba86f5528778b39c2106ef82670e0c (diff)
downloadbcm5719-llvm-971481db982d36338cbb2c096e98576dc5de2edc.tar.gz
bcm5719-llvm-971481db982d36338cbb2c096e98576dc5de2edc.zip
Verifier: 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 an "!dbg attachment points at wrong subprogram for function" assertion failure when the inliner sets up inline scope info. rdar://problem/25878916 llvm-svn: 267320
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