summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-10 01:32:56 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-10 01:32:56 +0000
commit692bdb910d67d04c1c6a86d6179e9b9b3365c41c (patch)
treed834c5cb38027785a1f69549ba67e7d3127be887 /llvm/lib
parent7960d04f13a14114b6a0a5ba2bce3ca37193134b (diff)
downloadbcm5719-llvm-692bdb910d67d04c1c6a86d6179e9b9b3365c41c.tar.gz
bcm5719-llvm-692bdb910d67d04c1c6a86d6179e9b9b3365c41c.zip
Verifier: Add simple checks for MDLocation
llvm-svn: 228647
Diffstat (limited to 'llvm/lib')
-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