summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Verifier.cpp
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2017-03-07 17:28:54 +0000
committerAdrian Prantl <aprantl@apple.com>2017-03-07 17:28:54 +0000
commit63d9695261a6014f7ea3f66977cc8c2d616dad9c (patch)
tree7ae4e297cda550bba1d7f69c381490662a7ccab7 /llvm/lib/IR/Verifier.cpp
parent9b24a450299dfe34644ecab194d6a8fcc0aa4f97 (diff)
downloadbcm5719-llvm-63d9695261a6014f7ea3f66977cc8c2d616dad9c.tar.gz
bcm5719-llvm-63d9695261a6014f7ea3f66977cc8c2d616dad9c.zip
Relax the conflicting function arg verifier to allow for inlined debug
info in nodebug functions. llvm-svn: 297161
Diffstat (limited to 'llvm/lib/IR/Verifier.cpp')
-rw-r--r--llvm/lib/IR/Verifier.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 19800ce5eec..ff98126529d 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -277,6 +277,9 @@ class Verifier : public InstVisitor<Verifier>, VerifierSupport {
/// already.
bool SawFrameEscape;
+ /// Whether the current function has a DISubprogram attached to it.
+ bool HasDebugInfo = false;
+
/// Stores the count of how many objects were passed to llvm.localescape for a
/// given function and the largest index passed to llvm.localrecover.
DenseMap<Function *, std::pair<unsigned, unsigned>> FrameEscapeInfo;
@@ -2122,6 +2125,7 @@ void Verifier::visitFunction(const Function &F) {
"Function is marked as dllimport, but not external.", &F);
auto *N = F.getSubprogram();
+ HasDebugInfo = (N != nullptr);
if (!N)
return;
@@ -4425,6 +4429,12 @@ void Verifier::verifyFragmentExpression(const DbgInfoIntrinsic &I) {
}
void Verifier::verifyFnArgs(const DbgInfoIntrinsic &I) {
+ // This function does not take the scope of noninlined function arguments into
+ // account. Don't run it if current function is nodebug, because it may
+ // contain inlined debug intrinsics.
+ if (!HasDebugInfo)
+ return;
+
DILocalVariable *Var;
if (auto *DV = dyn_cast<DbgValueInst>(&I)) {
// For performance reasons only check non-inlined ones.
OpenPOWER on IntegriCloud