[llvm-commits] Initial TableGen language reference

Sean Silva silvas at purdue.edu
Sun Jan 6 18:46:49 PST 2013


I landed this in r171685. Hopefully it will mature as people ask
questions about it.

-- Sean Silva

On Wed, Jan 2, 2013 at 7:41 PM, Sean Silva <silvas at purdue.edu> wrote:
> On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> +``class``\es
>>
>> IIRC, this needs a space after the backslash.
>
> It seems to render fine.
>
> On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> +A given class can only be defined once. A ``class`` declaration is
>> +considered to define the class if one of the following is true:
>>
>> s/one/any/, to be more precise?
>
> I like that. I have applied that locally.
>
> On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> +You can declare an empty class by giving and empty :token:`TemplateArgList`
>> +and an empty :token:`ObjectBody`.
>>
>> An example would be appropriate.
>
> See the warning at the top of the document ;) There are a lot of
> places in this document that I would _love_ to expand or add examples;
> the primary reason I haven't is simply exhaustion from slogging
> through the source code (I didn't just "write" this down; I did a
> depth-first traversal of every line of code in TGParser.cpp, which is
> painful).
>
> On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> +and an empty :token:`ObjectBody`. This can serve as a restricted form of
>> +forward declaration: note that records deriving from the forward-declared
>> +class will inherit no fields from it since the record expansion is done
>> +when the record is parsed.
>>
>> That's... interesting.  We might want to do something about it, unless
>> it is actually useful in an unexpected way.
>
> Indeed. One of the goals of this document is to bring these strange
> behaviors to light (or paper-over them if they can be safely ignored).
>
>
> On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> +Values
>> +------
>> +
>> +.. productionlist::
>> +   Value: `SimpleValue` ValueSuffix*
>>
>> `ValueSuffix`
>
> Fixed.
>
> On Wed, Jan 2, 2013 at 12:15 PM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
>> +The peculiar last form of :token:`RangePiece` is due to the fact that the
>> +``-`` is included in the :token:`TokInteger`, hence ``1-5`` gets lexed as
>>
>> "``-``" might be better (monospaced font alone does not make an
>> obvious difference).
>
> Good call. Fixed.
>
> New patch attached incorporating these changes and adding an introduction.
>
> -- Sean Silva



More information about the llvm-commits mailing list