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
This commit is contained in:
Sean Silva 2013-01-09 02:11:55 +00:00
parent 89f255e426
commit c95fe2804d
2 changed files with 8 additions and 2 deletions

View File

@ -370,6 +370,7 @@ applied at the end of parsing the base classes of a record.
.. productionlist:: .. productionlist::
MultiClass: "multiclass" `TokIdentifier` [`TemplateArgList`] MultiClass: "multiclass" `TokIdentifier` [`TemplateArgList`]
: [":" `BaseMultiClassList`] "{" `MultiClassDef`+ "}" : [":" `BaseMultiClassList`] "{" `MultiClassObject`+ "}"
BaseMultiClassList: `MultiClassID` ("," `MultiClassID`)* BaseMultiClassList: `MultiClassID` ("," `MultiClassID`)*
MultiClassID: `TokIdentifier` MultiClassID: `TokIdentifier`
MultiClassObject: `Def` | `Defm` | `Let` | `Foreach`

View File

@ -2160,7 +2160,12 @@ bool TGParser::ParseTopLevelLet(MultiClass *CurMultiClass) {
/// ParseMultiClass - Parse a multiclass definition. /// ParseMultiClass - Parse a multiclass definition.
/// ///
/// MultiClassInst ::= MULTICLASS ID TemplateArgList? /// MultiClassInst ::= MULTICLASS ID TemplateArgList?
/// ':' BaseMultiClassList '{' MultiClassDef+ '}' /// ':' BaseMultiClassList '{' MultiClassObject+ '}'
/// MultiClassObject ::= DefInst
/// MultiClassObject ::= MultiClassInst
/// MultiClassObject ::= DefMInst
/// MultiClassObject ::= LETCommand '{' ObjectList '}'
/// MultiClassObject ::= LETCommand Object
/// ///
bool TGParser::ParseMultiClass() { bool TGParser::ParseMultiClass() {
assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token"); assert(Lex.getCode() == tgtok::MultiClass && "Unexpected token");