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.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index fc6bc4ff9d1..e92aeac395e 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -4534,6 +4534,14 @@ void Verifier::visitDbgIntrinsic(StringRef Kind, DbgVariableIntrinsic &DII) {
&DII, BB, F, Var, Var->getScope()->getSubprogram(), Loc,
Loc->getScope()->getSubprogram());
+ // This check is redundant with one in visitLocalVariable().
+ AssertDI(isType(Var->getRawType()), "invalid type ref", Var,
+ Var->getRawType());
+ if (auto *Type = dyn_cast_or_null<DIType>(Var->getRawType()))
+ if (Type->isBlockByrefStruct())
+ AssertDI(DII.getExpression() && DII.getExpression()->getNumElements(),
+ "BlockByRef variable without complex expression", Var, &DII);
+
verifyFnArgs(DII);
}
OpenPOWER on IntegriCloud