1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 19:23:23 +01:00
llvm-mirror/docs/TableGen
Simon Tatham d6b1d9a9cf Fix BNF nits in TableGen language reference.
Summary:
In the course of writing an experimental ANTLR grammar based on this
document, I found three errors in the documented BNF:

SimpleValues of dag type are allowed to have no operands at all after
the initial DagArg specifying the operator. For example, the value
(outs) is extremely common in backends; an example in the test suite
is test/TableGen/AsmVariant.td line 30. But the BNF doesn't allow
DagArgList to expand to the empty string (it must contain at least one
DagArg), and therefore the DagArgList specifying the operands in the
dag-shaped production for SimpleValue should be optional.

In the production for BodyItem with a 'let' and an optional RangeList,
the RangeList should have braces around it if it's present, matching
code such as "let E{7-0} = ..." on test/TableGen/BitsInit.td line 42.
Those braces aren't included in the RangeList nonterminal itself, so
instead they need to be part of the optional segment of the BodyItem
production.

Finally, the identifier after 'defm' should be optional. Again, this
is very common in the real back end .td files; an example in the test
suite is in test/TableGen/defmclass.td line 49.

Reviewers: rengolin, nhaehnle, stoklund

Reviewed By: nhaehnle

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D45818

llvm-svn: 330570
2018-04-23 09:15:47 +00:00
..
BackEnds.rst [X86][AVX512] Adding new LLVM TableGen backend which generates the EVEX2VEX compressing tables. 2017-03-07 08:11:19 +00:00
Deficiencies.rst Re-factor TableGen docs 2014-03-20 16:08:34 +00:00
index.rst Test commit access. 2018-04-23 08:41:53 +00:00
LangIntro.rst TableGen: Remove the cast-from-string-to-variable-reference feature 2018-03-19 14:13:37 +00:00
LangRef.rst Fix BNF nits in TableGen language reference. 2018-04-23 09:15:47 +00:00