[PATCH] D32117: Update TableGen LangIntro.rst

Wei-Ren Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 16 01:40:18 PDT 2017


chenwj created this revision.

Update a few places in TableGen LangIntro.rst.

- Only one-line double-quoted string literal considered as `string` type, see how check is done in `TGLexer::LexString()

` (TGLexer.cpp).

- ``string`` type value can be converted to ``code`` type, but not the other way around. See `StringRecTy::classof` and `CodeRecTy::classof` (Record.h).



- Clarify `value{15-17}` and `value{17-15}` actually are different things, as discussed on About TableGen RangeList <http://lists.llvm.org/pipermail/llvm-dev/2017-April/112116.html>.


https://reviews.llvm.org/D32117

Files:
  docs/TableGen/LangIntro.rst


Index: docs/TableGen/LangIntro.rst
===================================================================
--- docs/TableGen/LangIntro.rst
+++ docs/TableGen/LangIntro.rst
@@ -55,8 +55,10 @@
     The 'int' type represents a simple 32-bit integer value, such as 5.
 
 ``string``
-    The 'string' type represents an ordered sequence of characters of arbitrary
-    length.
+    The 'string' type represents an ordered sequence of characters in single line.
+
+``code``
+    The `code` type represents a code fragment, which can be single/multi-line string literal.
 
 ``bits<n>``
     A 'bits' type is an arbitrary, but fixed, size integer that is broken up
@@ -105,7 +107,7 @@
     hexadecimal integer value
 
 ``"foo"``
-    string value
+    string value, can be assigned to ``string`` or ``code`` varible.
 
 ``[{ ... }]``
     usually called a "code fragment", but is just a multiline string literal
@@ -126,7 +128,8 @@
     access to one bit of a value
 
 ``value{15-17}``
-    access to multiple bits of a value
+    access to multiple bits of a value. The order matters, ``value{15-17}`` and ``value{17-15}``
+    get opposite results.
 
 ``DEF``
     reference to a record definition


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32117.95396.patch
Type: text/x-patch
Size: 1187 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170416/3a069105/attachment.bin>


More information about the llvm-commits mailing list