IR: Allow MDSubrange to have 'count: -1'
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 18 Feb 2015 23:17:51 +0000 (23:17 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Wed, 18 Feb 2015 23:17:51 +0000 (23:17 +0000)
commitc2c5e48ad587a99a92ce55265cce20fdb235af70
treeae4f142f66c1d7c619ade4e5f2631e8ebd1e44e2
parentf89d9b1c75d0a1db28425670076a369172bc98bb
IR: Allow MDSubrange to have 'count: -1'

It turns out that `count: -1` is a special value indicating an empty
array, such as `Values` in:

    struct T {
      unsigned Count;
      int Values[];
    };

Handle it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229769 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AsmParser/LLParser.cpp
test/Assembler/invalid-mdsubrange-count-negative.ll
test/Assembler/mdsubrange-empty-array.ll [new file with mode: 0644]
unittests/IR/MetadataTest.cpp