Verifier: Check debug info intrinsic arguments
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 15 Mar 2015 01:21:30 +0000 (01:21 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sun, 15 Mar 2015 01:21:30 +0000 (01:21 +0000)
commit08e687e68451ce435724e7e85c52303090da0b1b
tree283898b5612e9194c62703b08fe9c53af65358ea
parent48248ac8a0d6c908a47ce1c9d1fc39c4206c7b3d
Verifier: Check debug info intrinsic arguments

Verify that debug info intrinsic arguments are valid.  (These checks
will not recurse through the full debug info graph, so they don't need
to be cordoned of in `DebugInfoVerifier`.)

With those checks in place, changing the `DbgIntrinsicInst` accessors to
downcast to `MDLocalVariable` and `MDExpression` is natural (added isa
specializations in `Metadata.h` to support this).

Added tests to `test/Verifier` for the new -verify checks, and fixed the
debug info in all the in-tree tests.

If you have out-of-tree testcases that have started to fail to -verify,
hopefully the verify checks are helpful.  The most likely problem is
that the expression argument is `!{}` (instead of `!MDExpression()`).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232296 91177308-0d34-0410-b5e6-96231b3b80d8
30 files changed:
include/llvm/IR/IntrinsicInst.h
lib/IR/Verifier.cpp
test/DebugInfo/2010-03-19-DbgDeclare.ll
test/Transforms/AddDiscriminators/no-discriminators.ll
test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
test/Transforms/DeadStoreElimination/inst-limits.ll
test/Transforms/GCOVProfiling/linezero.ll
test/Transforms/Inline/ignore-debug-info.ll
test/Transforms/InstCombine/debuginfo.ll
test/Transforms/LICM/debug-value.ll
test/Transforms/LoopIdiom/debug-line.ll
test/Transforms/LoopRotate/dbgvalue.ll
test/Transforms/LoopVectorize/dbg.value.ll
test/Transforms/LoopVectorize/debugloc.ll
test/Transforms/Mem2Reg/ConvertDebugInfo.ll
test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
test/Transforms/ObjCARC/basic.ll
test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
test/Transforms/SLPVectorizer/X86/debug_info.ll
test/Transforms/SampleProfile/branch.ll
test/Transforms/ScalarRepl/debuginfo-preserved.ll
test/Transforms/Scalarizer/dbginfo.ll
test/Transforms/SimplifyCFG/hoist-dbgvalue.ll
test/Transforms/StripSymbols/strip-dead-debug-info.ll
test/Verifier/llvm.dbg.declare-address.ll [new file with mode: 0644]
test/Verifier/llvm.dbg.declare-expression.ll [new file with mode: 0644]
test/Verifier/llvm.dbg.declare-variable.ll [new file with mode: 0644]
test/Verifier/llvm.dbg.value-expression.ll [new file with mode: 0644]
test/Verifier/llvm.dbg.value-value.ll [new file with mode: 0644]
test/Verifier/llvm.dbg.value-variable.ll [new file with mode: 0644]