Commit Graph

9 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen 91a5848cab Allow TableGen DAG arguments to be just a name.
DAG arguments can optionally be named:

  (dag node, node:$name)

With this change, the node is also optional:

  (dag node, node:$name, $name)

The missing node is treated as an UnsetInit, so the above is equivalent
to:

  (dag node, node:$name, ?:$name)

This syntax is useful in output patterns where we currently require the
types of variables to be repeated:

  def : Pat<(subc i32:$b, i32:$c), (SUBCCrr i32:$b, i32:$c)>;

This is preferable:

  def : Pat<(subc i32:$b, i32:$c), (SUBCCrr $b, $c)>;

llvm-svn: 177843
2013-03-24 19:36:51 +00:00
Sean Silva 59e7bd5b5e [docs] Fixup fallout from other grammar fixup.
My "excuse" for not refactoring the grammar here is to not diverge too
far from the grammar in the comments of TGParser.cpp, since I'm not
taking on the quest of majorly refactoring TGParser.cpp at the moment.

One benefit of doing this is that Ideas for refactoring and clarifying
the grammar in this document should translate almost immediately to
beneficial refactorings that can be made to TGParser.cpp.

llvm-svn: 174144
2013-02-01 03:50:20 +00:00
Sean Silva 6868ac4c9c [docs] Add missing colon to TableGen grammar.
Spotted by Eli Bendersky.

llvm-svn: 174143
2013-02-01 03:32:38 +00:00
Hal Finkel c7d4dc13a4 Add an addition operator to TableGen
This adds an !add(a, b) operator to tablegen; this will be used
to cleanup the PPC register definitions.

llvm-svn: 173445
2013-01-25 14:49:08 +00:00
Sean Silva 45e4147345 TableGen/LangRef: link bang operators into the productionlist
Now BangOperator should be nicely hyperlinked.

Pointed out by Joel Jones.

llvm-svn: 171942
2013-01-09 02:20:31 +00:00
Sean Silva 543fd7f8be TableGen/LangRef: discuss specific C-like escapes
Suggested by Joel Jones.

llvm-svn: 171941
2013-01-09 02:20:30 +00:00
Sean Silva dce94d3bd2 docs: Fix mention of DefmID to MultiClassID.
llvm-svn: 171940
2013-01-09 02:20:24 +00:00
Sean Silva c95fe2804d docs: Bring TableGen syntax a bit closer to reality.
It's not just def's but actually a limited subset of Object's that are
allowed inside a multiclass.

Spotted by Joel Jones.

llvm-svn: 171935
2013-01-09 02:11:55 +00:00
Sean Silva 1b60018178 tblgen, docs: Add initial syntax reference.
llvm-svn: 171685
2013-01-07 02:43:44 +00:00