Verifier: Check operands of MDType subclasses and MDCompileUnit
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 27 Mar 2015 23:05:04 +0000 (23:05 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 27 Mar 2015 23:05:04 +0000 (23:05 +0000)
commitb943370653917d8a674aaa9a47efc2965fd6dad3
tree706e94d39d8c61922a99828eb6789b5526873c33
parent6ed3a762fcce2b4ac8f232cd61dd07ee807b2a59
Verifier: Check operands of MDType subclasses and MDCompileUnit

Add verify checks for `MDType` subclasses and for `MDCompileUnit`.
These new checks don't yet incorporate everything from `Verify()`, but
at least they sanity check the operands.  Also downcast accessors as
possible.

A lot of these accessors can't be downcast as far as we'd like because
of arrays of typed objects (stored in a generic `MDTuple`) and
`MDString`-based type references.  Eventually I'll port over `DIRef<>`
and `DITypedArray<>` from `DebugInfo.h` to clean those up as well.

Updated bitrotted testcases separately in r233415 and r233443 to reduce
churn on the off-chance this needs to be reverted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233446 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/DIBuilder.h
include/llvm/IR/DebugInfoMetadata.h
lib/IR/AsmWriter.cpp
lib/IR/DIBuilder.cpp
lib/IR/LLVMContextImpl.h
lib/IR/Verifier.cpp
unittests/IR/MetadataTest.cpp