X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=docs%2FTableGenFundamentals.html;h=ca327ce421fc11e74a5bc46b5a8a8354322f3aa3;hb=004e19e38d810c3146c77b68a9274210ee008b1d;hp=c63c5cef5fa8190c785bc8619fe9153a0b77fd4e;hpb=85234aca74411051406287a3b1991947feff6810;p=oota-llvm.git diff --git a/docs/TableGenFundamentals.html b/docs/TableGenFundamentals.html index c63c5cef5fa..ca327ce421f 100644 --- a/docs/TableGenFundamentals.html +++ b/docs/TableGenFundamentals.html @@ -41,13 +41,13 @@
  1. todo
-
  • The LLVM code generator -
      -
    1. todo
    2. -
  • +
    +

    Written by Chris Lattner

    +
    +
    Introduction
    @@ -64,7 +64,7 @@ makes it easier to structure domain specific information.

    The core part of TableGen parses a file, instantiates the declarations, and hands the result off to a domain-specific "TableGen backend" for processing. The current major user -of TableGen is the LLVM code generator.

    +of TableGen is the LLVM code generator.

    Note that if you work on TableGen much, and use emacs or vim, that you can find an emacs "TableGen mode" and a vim language file in @@ -230,7 +230,8 @@ the line, and it also supports nestable "/* */" comments.

    -
    The TableGen type system +
    + The TableGen type system
    @@ -287,31 +288,33 @@ needed.

    TableGen values and expressions
    -
    +
    +

    TableGen allows for a pretty reasonable number of different expression forms when building up values. These forms allow the TableGen file to be written in a natural syntax and flavor for the application. The current expression forms supported include:

      -
    • ? - Uninitialized field.
    • -
    • 0b1001011 - Binary integer value.
    • -
    • 07654321 - Octal integer value (indicated by a leading 0).
    • -
    • 7 - Decimal integer value.
    • -
    • 0x7F - Hexadecimal integer value.
    • -
    • "foo" - String value.
    • -
    • [{ .... }] - Code fragment.
    • -
    • [ X, Y, Z ] - List value.
    • -
    • { a, b, c } - Initializer for a "bits<3>" value.
    • -
    • value - Value reference.
    • -
    • value{17} - Access to one or more bits of a value.
    • -
    • DEF - Reference to a record definition.
    • -
    • X.Y - Reference to the subfield of a value.
    • - -
    • (DEF a, b) - A dag value. The first element is required to be a record -definition, the remaining elements in the list may be arbitrary other values, -including nested 'dag' values.
    • - +
    • ? - uninitialized field
    • +
    • 0b1001011 - binary integer value
    • +
    • 07654321 - octal integer value (indicated by a leading 0)
    • +
    • 7 - decimal integer value
    • +
    • 0x7F - hexadecimal integer value
    • +
    • "foo" - string value
    • +
    • [{ ... }] - code fragment
    • +
    • [ X, Y, Z ] - list value.
    • +
    • { a, b, c } - initializer for a "bits<3>" value
    • +
    • value - value reference
    • +
    • value{17} - access to one bit of a value
    • +
    • value{15-17} - access to multiple bits of a value
    • +
    • DEF - reference to a record definition
    • +
    • X.Y - reference to the subfield of a value
    • +
    • list[4-7,17,2-3] - A slice of the 'list' list, including elements +4,5,6,7,17,2, and 3 from it. Elements may be included multiple times.
    • +
    • (DEF a, b) - a dag value. The first element is required to be a +record definition, the remaining elements in the list may be arbitrary other +values, including nested `dag' values.

    Note that all of the values have rules specifying how they convert to values @@ -321,15 +324,17 @@ for different types. These rules allow you to assign a value like "7" to a

    -
    Classes and definitions + -
    +
    +

    As mentioned in the intro, classes and definitions (collectively known as 'records') in TableGen are the main high-level unit of information that TableGen collects. Records are defined with a def or class keyword, the record name, and an optional list of "template arguments". If the record has superclasses, +href="#templateargs">template arguments". If the record has superclasses, they are specified as a comma seperated list that starts with a colon character (":"). If value definitions or let expressions are needed for the class, they are enclosed in curly braces @@ -542,18 +547,6 @@ about any particular backend, except maybe -print-enums as an example. This should highlight the APIs in TableGen/Record.h.

    - - - - -
    -

    This is just a temporary, convenient, place to put stuff about the code -generator before it gets its own document. This should describe all of the -tablegen backends used by the code generator and the classes/definitions they -expect.

    -
    -