DI/Verifier: Fix argument bitrot in DILocalVariable
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 24 Jul 2015 23:59:25 +0000 (23:59 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 24 Jul 2015 23:59:25 +0000 (23:59 +0000)
commitcbfbb3ee4c9b215cd367db3b64dfef0a7f334369
tree320e6c0884958a8fdb6238bcc06299f373e0a8f3
parent3a8b87d9ce0356bb565a26b39838c9e1a7292a1c
DI/Verifier: Fix argument bitrot in DILocalVariable

Add a verifier check that `DILocalVariable`s of tag
`DW_TAG_arg_variable` always have a non-zero 'arg:' field, and those of
tag `DW_TAG_auto_variable` always have a zero 'arg:' field.  These are
the only configurations that are properly understood by the backend.

(Also, fix the bad examples in LangRef and test/Assembler, and fix the
bug in Kaleidoscope Ch8.)

A large number of testcases seem to have bitrotted their way forward
from some ancient version of the debug info hierarchy that didn't have
`arg:` parameters.  If you have out-of-tree testcases that start failing
in the verifier and you don't care enough to get the `arg:` right, you
may have some luck just calling:

    sed -e 's/, arg: 0/, arg: 1/'

or some such, but I hand-updated the ones in tree.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243183 91177308-0d34-0410-b5e6-96231b3b80d8
45 files changed:
docs/LangRef.rst
docs/tutorial/LangImpl8.rst
examples/Kaleidoscope/Chapter8/toy.cpp
lib/IR/Verifier.cpp
test/Assembler/dilocalvariable.ll
test/Assembler/invalid-dilocalvariable-arg-negative.ll
test/CodeGen/ARM/2010-04-15-ScavengerDebugValue.ll
test/CodeGen/ARM/2010-06-25-Thumb2ITInvalidIterator.ll
test/CodeGen/ARM/2010-08-04-StackVariable.ll
test/CodeGen/ARM/2011-01-19-MergedGlobalDbg.ll
test/CodeGen/ARM/debug-info-d16-reg.ll
test/CodeGen/Generic/dbg_value.ll
test/CodeGen/X86/2009-02-12-DebugInfoVLA.ll
test/CodeGen/X86/2010-01-18-DbgValue.ll
test/CodeGen/X86/2010-05-25-DotDebugLoc.ll
test/CodeGen/X86/2010-05-26-DotDebugLoc.ll
test/CodeGen/X86/2010-05-28-Crash.ll
test/CodeGen/X86/2010-06-01-DeadArg-DbgInfo.ll
test/CodeGen/X86/2010-08-04-StackVariable.ll
test/CodeGen/X86/2010-11-02-DbgParameter.ll
test/CodeGen/X86/2011-01-24-DbgValue-Before-Use.ll
test/CodeGen/X86/unknown-location.ll
test/DebugInfo/2010-03-12-llc-crash.ll
test/DebugInfo/2010-03-24-MemberFn.ll
test/DebugInfo/2010-04-06-NestedFnDbgInfo.ll
test/DebugInfo/2010-05-03-DisableFramePtr.ll
test/DebugInfo/2010-05-03-OriginDIE.ll
test/DebugInfo/2010-06-29-InlinedFnLocalVar.ll
test/DebugInfo/2010-10-01-crash.ll
test/DebugInfo/Mips/InlinedFnLocalVar.ll
test/DebugInfo/X86/2010-04-13-PubType.ll
test/DebugInfo/X86/InlinedFnLocalVar.ll
test/DebugInfo/X86/dbg-byval-parameter.ll
test/DebugInfo/X86/dbg-merge-loc-entry.ll
test/DebugInfo/X86/dbg-value-dag-combine.ll
test/DebugInfo/X86/dbg-value-isel.ll
test/DebugInfo/X86/dbg-value-location.ll
test/DebugInfo/X86/dbg-value-range.ll
test/DebugInfo/inheritance.ll
test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
test/Transforms/GlobalOpt/2009-03-05-dbg.ll
test/Transforms/LoopRotate/dbgvalue.ll
test/Transforms/Mem2Reg/ConvertDebugInfo.ll
test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
test/Transforms/StripSymbols/strip-dead-debug-info.ll