Use makeArrayRef and None to simplify some code in a tablegen register info file...
authorCraig Topper <craig.topper@gmail.com>
Tue, 22 Sep 2015 05:37:12 +0000 (05:37 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 22 Sep 2015 05:37:12 +0000 (05:37 +0000)
commite32e1f4c62b39ad9cca2aa67d6612f21255163bb
tree8ca09a16cc9e1b62bde1d51bd1143937cc9f1ee0
parentd89d4bccffbd23bea821af7fd09201f4e9abc546
Use makeArrayRef and None to simplify some code in a tablegen register info file. Additionally const correct a couple static array.

Previously the code added an extra nullptr entry to a static array and then created an ArrayRef with a size one less than the static array. If there were no other entries the array would just contain the nullptr and the ArrayRef would be crated with size 0.

Instead, put the right number of entries in the array and explicitly emit 'None' if the size would be 0. This allows the static array constructor of makeArrayRef to be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248244 91177308-0d34-0410-b5e6-96231b3b80d8
utils/TableGen/RegisterInfoEmitter.cpp