OSDN Git Service

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)
commit42c1227fd99a396d83e15317c4cc17d6552379c3
tree4aa1889ef989efed9541d59071460722f3e6ecf7
parentf5b7351124ed4a871112cfb63daa68bac22b2b28
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;

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215084 91177308-0d34-0410-b5e6-96231b3b80d8
lib/TableGen/TGLexer.cpp
lib/TableGen/TGLexer.h
lib/TableGen/TGParser.cpp
test/TableGen/BitsInit.td