summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2016-04-24 22:23:13 +0000
committerAdrian Prantl <aprantl@apple.com>2016-04-24 22:23:13 +0000
commit93035c8f47589590b65041603524f48a7c007e1f (patch)
tree59a23b722e790e923a44f3896d1dd1dbb2afb8d9 /llvm/lib/IR/Verifier.cpp
parent1858c664de64fc8829bf09571aa82f6f4cea49b9 (diff)
downloadbcm5719-llvm-93035c8f47589590b65041603524f48a7c007e1f.tar.gz
bcm5719-llvm-93035c8f47589590b65041603524f48a7c007e1f.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 This reaplies r267320 without changes after fixing an issue in the OpenMP IR generator in clang. llvm-svn: 267370
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