summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR')
-rw-r--r--llvm/lib/IR/Verifier.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index 7e10e4e1cee..c8aba14e813 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -956,6 +956,9 @@ void Verifier::visitDISubprogram(const DISubprogram &N) {
Assert(!hasConflictingReferenceFlags(N.getFlags()), "invalid reference flags",
&N);
+ if (N.isDefinition())
+ Assert(N.isDistinct(), "subprogram definitions must be distinct", &N);
+
auto *F = N.getFunction();
if (!F)
return;
OpenPOWER on IntegriCloud