Enforce suitable literal number operands to be unsigned integers.
authorLei Zhang <antiagainst@google.com>
Wed, 14 Oct 2015 21:02:39 +0000 (17:02 -0400)
committerDavid Neto <dneto@google.com>
Mon, 26 Oct 2015 16:55:33 +0000 (12:55 -0400)
commit6483bd7132400d75c73ad1efe8c163f5fb4d25e8
tree1cee5956832ca72aa8c0d1b7bdc3895bb85fb6c6
parent5d65ea726c15b51c63480cf97c5013a717ff6b10
Enforce suitable literal number operands to be unsigned integers.

Except for OpConstant and OpSpecConstant, all other literal number
operands are indeed unsigned integers. So,

* Rename all *LITERAL_NUMBER* operand types to *LITERAL_INTEGER*.
* Expect unsigned integers for *LITERAL_INTEGER* operands.
* Keep MULITPLE_WORD_LITERAL untouched since it is only used by
  OpConstant and OpSpecConstant.

And we want to provide the capability to specify floating-point
numbers after !<integer> in the alternate parsing mode. So,
OPTIONAL_LITERAL_NUMBER is reserved for OPTIONAL_CIV.
12 files changed:
CMakeLists.txt
include/libspirv/libspirv.h
include/util/bitwisecast.h [moved from source/bitwisecast.h with 100% similarity]
source/binary.cpp
source/opcode.cpp
source/operand.cpp
source/text.cpp
source/text_handler.cpp
source/validate.cpp
test/ImmediateInt.cpp
test/OperandPattern.cpp
test/TextToBinary.Literal.cpp