TableGen: Support folding casts from bits to int
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 31 Jul 2015 01:12:06 +0000 (01:12 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 31 Jul 2015 01:12:06 +0000 (01:12 +0000)
commit6a224c30a5d358305e6cfda1a62a78f658baa943
treec0ff4b4b6d3f3f17604921513c65b0d129ebd105
parenta29a752cf5d4616184ff8be36d7943f4d182f9b9
TableGen: Support folding casts from bits to int

This is to fix an incorrect error when trying to initialize
DwarfNumbers with a !cast<int> of a bits initializer.
getValuesAsListOfInts("DwarfNumbers") would not see an IntInit
and instead the cast, so would give up.

It seems likely that this could be generalized to attempt
the convertInitializerTo for any type. I'm not really sure
why the existing code seems to special case the string cast cases
when convertInitializerTo seems like it should generally handle this
sort of thing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243722 91177308-0d34-0410-b5e6-96231b3b80d8
lib/TableGen/Record.cpp
test/TableGen/cast-list-initializer.td [new file with mode: 0644]