[llvm] r215088 - Update Tablegen documents given that binary literals are now sized
Pete Cooper
peter_cooper at apple.com
Wed Aug 6 22:47:13 PDT 2014
Author: pete
Date: Thu Aug 7 00:47:13 2014
New Revision: 215088
URL: http://llvm.org/viewvc/llvm-project?rev=215088&view=rev
Log:
Update Tablegen documents given that binary literals are now sized
Modified:
llvm/trunk/docs/TableGen/LangIntro.rst
llvm/trunk/docs/TableGen/LangRef.rst
Modified: llvm/trunk/docs/TableGen/LangIntro.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/TableGen/LangIntro.rst?rev=215088&r1=215087&r2=215088&view=diff
==============================================================================
--- llvm/trunk/docs/TableGen/LangIntro.rst (original)
+++ llvm/trunk/docs/TableGen/LangIntro.rst Thu Aug 7 00:47:13 2014
@@ -94,7 +94,9 @@ supported include:
uninitialized field
``0b1001011``
- binary integer value
+ binary integer value.
+ Note that this is sized by the number of bits given and will not be
+ silently extended/truncated.
``07654321``
octal integer value (indicated by a leading 0)
@@ -116,8 +118,9 @@ supported include:
In rare cases, TableGen is unable to deduce the element type in which case
the user must specify it explicitly.
-``{ a, b, c }``
- initializer for a "bits<3>" value
+``{ a, b, 0b10 }``
+ initializer for a "bits<4>" value.
+ 1-bit from "a", 1-bit from "b", 2-bits from 0b10.
``value``
value reference
Modified: llvm/trunk/docs/TableGen/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/TableGen/LangRef.rst?rev=215088&r1=215087&r2=215088&view=diff
==============================================================================
--- llvm/trunk/docs/TableGen/LangRef.rst (original)
+++ llvm/trunk/docs/TableGen/LangRef.rst Thu Aug 7 00:47:13 2014
@@ -55,6 +55,10 @@ One aspect to note is that the :token:`D
``+`` or ``-``, as opposed to having ``+`` and ``-`` be unary operators as
most languages do.
+Also note that :token:`BinInteger` creates a value of type ``bits<n>``
+(where ``n`` is the number of bits). This will implicitly convert to
+integers when needed.
+
TableGen has identifier-like tokens:
.. productionlist::
More information about the llvm-commits
mailing list