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, 7 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp
index e1b6f944f8a..ab3a2735df3 100644
--- a/llvm/lib/IR/Verifier.cpp
+++ b/llvm/lib/IR/Verifier.cpp
@@ -678,7 +678,13 @@ void Verifier::visitMetadataAsValue(const MetadataAsValue &MDV, Function *F) {
visitValueAsMetadata(*V, F);
}
-void Verifier::visitMDLocation(const MDLocation &) {}
+void Verifier::visitMDLocation(const MDLocation &N) {
+ Assert1(N.getScope(), "location requires a valid scope", &N);
+ if (N.getInlinedAt())
+ Assert2(isa<MDLocation>(N.getInlinedAt()),
+ "inlined-at should be a location", &N, N.getInlinedAt());
+}
+
void Verifier::visitGenericDebugNode(const GenericDebugNode &) {}
void Verifier::visitMDSubrange(const MDSubrange &) {}
void Verifier::visitMDEnumerator(const MDEnumerator &) {}
OpenPOWER on IntegriCloud