Change TableGen so that binary literals such as 0b001 are now sized.
authorPete Cooper <peter_cooper@apple.com>
Thu, 7 Aug 2014 05:47:00 +0000 (05:47 +0000)
committerPete Cooper <peter_cooper@apple.com>
Thu, 7 Aug 2014 05:47:00 +0000 (05:47 +0000)
commit2597764ad95e1972d071ca89f0366277bcb56b9a
tree5d318f532de8a42fc18deab4ed62141b6ecbb239
parent99ad2a3b6752de11e17460055f02c0a52132eae1
Change TableGen so that binary literals such as 0b001 are now sized.

Instead of these becoming an integer literal internally, they now become bits<n> values.

Prior to this change, 0b001 was 1 bit long.  This is confusing as clearly the user gave 3 bits.
This new type holds both the literal value and the size, and so can ensure sizes match on initializers.

For example, this used to be legal

bits<1> x = 0b00;

but now it must be written as

bits<2> x = 0b00;

llvm-svn: 215084
llvm/lib/TableGen/TGLexer.cpp
llvm/lib/TableGen/TGLexer.h
llvm/lib/TableGen/TGParser.cpp
llvm/test/TableGen/BitsInit.td