Verifier: Check fields of MDVariable subclasses
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 27 Mar 2015 17:29:58 +0000 (17:29 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 27 Mar 2015 17:29:58 +0000 (17:29 +0000)
commita9902daa5c1bdb080bc850e46f653ea7db055573
tree79062ab178a39613a0c1763e76c7364296a8d9b0
parent2ee615297c12f492dd695e8dad9066ea51ba6dbc
Verifier: Check fields of MDVariable subclasses

Check fields from `MDLocalVariable` and `MDGlobalVariable` and change
the accessors to downcast to the right types.  `getType()` still returns
`Metadata*` since it could be an `MDString`-based reference.

Since local variables require non-null scopes, I also updated `LLParser`
to require a `scope:` field.

A number of testcases had grown bitrot and started failing with this
patch; I committed them separately in r233349.  If I just broke your
out-of-tree testcases, you're probably hitting similar problems (so have
a look there).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233389 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/llvm/IR/DebugInfoMetadata.h
lib/AsmParser/LLParser.cpp
lib/IR/AsmWriter.cpp
lib/IR/DIBuilder.cpp
lib/IR/LLVMContextImpl.h
lib/IR/Verifier.cpp
test/Assembler/invalid-mdlocalvariable-missing-name.ll [deleted file]
test/Assembler/invalid-mdlocalvariable-missing-scope.ll [new file with mode: 0644]
test/Assembler/invalid-mdlocalvariable-missing-tag.ll [new file with mode: 0644]
test/Assembler/mdglobalvariable.ll
test/Assembler/mdlocalvariable.ll
test/Verifier/llvm.dbg.declare-address.ll
test/Verifier/llvm.dbg.declare-expression.ll
test/Verifier/llvm.dbg.value-expression.ll
test/Verifier/llvm.dbg.value-value.ll
unittests/IR/MetadataTest.cpp