[llvm] r228647 - Verifier: Add simple checks for MDLocation
Duncan P. N. Exon Smith
dexonsmith at apple.com
Mon Feb 9 17:32:56 PST 2015
Author: dexonsmith
Date: Mon Feb 9 19:32:56 2015
New Revision: 228647
URL: http://llvm.org/viewvc/llvm-project?rev=228647&view=rev
Log:
Verifier: Add simple checks for MDLocation
Modified:
llvm/trunk/lib/IR/Verifier.cpp
Modified: llvm/trunk/lib/IR/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Verifier.cpp?rev=228647&r1=228646&r2=228647&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Verifier.cpp (original)
+++ llvm/trunk/lib/IR/Verifier.cpp Mon Feb 9 19:32:56 2015
@@ -678,7 +678,13 @@ void Verifier::visitMetadataAsValue(cons
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 &) {}
More information about the llvm-commits
mailing list