DI/Verifier: Fix argument bitrot in DILocalVariable
[oota-llvm.git] / lib / IR / Verifier.cpp
index 3b041b088f2d5ce872a2c379206a6cd0a55f34b8..12e4f4ed0565ac15f0ad4a74f07c31683344e60c 100644 (file)
@@ -1063,6 +1063,8 @@ void Verifier::visitDILocalVariable(const DILocalVariable &N) {
          "invalid tag", &N);
   Assert(N.getRawScope() && isa<DILocalScope>(N.getRawScope()),
          "local variable requires a valid scope", &N, N.getRawScope());
+  Assert(bool(N.getArg()) == (N.getTag() == dwarf::DW_TAG_arg_variable),
+         "local variable should have arg iff it's a DW_TAG_arg_variable", &N);
 }
 
 void Verifier::visitDIExpression(const DIExpression &N) {