summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/TGParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Parse Def ID as ValueDavid Greene2011-10-191-13/+41
| | | | | | | Allow def and defm IDs to be general values. We need this for paste functionality. llvm-svn: 142522
* Don't Parse Object Body as a NameDavid Greene2011-10-191-0/+4
| | | | | | | | Stop parsing a value if we are in name parsing mode and we see a left brace. A left brace indicates the start of an object body when we are parsing a name. llvm-svn: 142521
* Use Parse ModeDavid Greene2011-10-191-2/+9
| | | | | | | Augment the value parser to respect the parse mode and not error if an ID doesn't map to an object and we are in name parsing mode. llvm-svn: 142520
* Make ID Parsing More FlexibleDavid Greene2011-10-191-6/+8
| | | | | | | | | | | | | | | | | | | Add a mode control to value and ID parsers. The two modes are: - Parse a value. Expect the parsed ID to map to an existing object. - Parse a name. Expect the parsed ID to not map to any existing object. The first is used when parsing an identifier to be looked up, for example a record field or template argument. The second is used for parsing declarations. Paste functionality implies that declarations can contain arbitrary expressions so we need to be able to call into the general value parser to parse declarations with paste operators. So we need a way to parse a value-like thing without expecting that the result will map to some existing object. This parse mode provides that. llvm-svn: 142519
* Add NAME MemberDavid Greene2011-10-191-1/+1
| | | | | | | | Add a Value named "NAME" to each Record. This will be set to the def or defm name when instantiating multiclasses. This will replace the #NAME# processing hack once paste functionality is in place. llvm-svn: 142518
* Fix Name AccessDavid Greene2011-10-191-2/+3
| | | | | | Get the Record name as a string explicitly to avoid asserts. llvm-svn: 142517
* Fix Name AccessDavid Greene2011-10-191-1/+2
| | | | | | Get the Record name as a string explicitly to avoid asserts. llvm-svn: 142516
* Fix Name AccessDavid Greene2011-10-191-2/+3
| | | | | | Get the Record name as a string explicitly to avoid asserts. llvm-svn: 142515
* Fix Name AccessDavid Greene2011-10-191-1/+2
| | | | | | Get the Record name by string explicitly to avoid potential asserts. llvm-svn: 142514
* Make Template Arg Names InitsDavid Greene2011-10-191-29/+35
| | | | | | | | Allow template arg names to be Inits. This is further work to implement paste as it allows template names to participate in paste operations. llvm-svn: 142500
* Let SetValue Take and Init NameDavid Greene2011-10-191-8/+11
| | | | | | | Convert SetValue to take the value name as an Init. This allows us to set values for variables whose names are not yet fully resolved. llvm-svn: 142499
* Remove MultidefsDavid Greene2011-10-071-175/+1
| | | | | | | | | | | | | | | | | | | Multidefs are a bit unwieldy and incomplete. Remove them in favor of another mechanism, probably for loops. Revert "Make Test More Thorough" Revert "Fix a typo." Revert "Vim Support for Multidefs" Revert "Emacs Support for Multidefs" Revert "Document Multidefs" Revert "Add a Multidef Test" Revert "Update Test for Multidefs" Revert "Process Multidefs" Revert "Parser Multidef Support" Revert "Lexer Support for Multidefs" Revert "Add Multidef Data Structures" llvm-svn: 141378
* Prefix Template Arg Names with Multiclass NameDavid Greene2011-10-051-0/+3
| | | | | | | | For consistency, prefix multiclass template arg names with the multiclass name followed by "::" to avoid name clashes among multiclass arguments and other entities in the multiclass. llvm-svn: 141239
* Process MultidefsDavid Greene2011-10-051-0/+86
| | | | | | | | | | Process each multidef declared in a multiclass. Iterate through the list and instantiate a def in the multiclass for each item, resolving the list item to the temporary iterator (possibly) used in the multidef ObjectBody. We then process each generated def in the normal way. llvm-svn: 141233
* Parser Multidef SupportDavid Greene2011-10-051-1/+88
| | | | | | | | | | | | | | | Add parser support to recognize multidefs. No processing on the multidef is done at this point. The grammar is: MultiDef = MULTIDEF ObjectName < Value, Declaration, Value > ObjectBody The first Value must be resolveable to a list and the second Value must be resolveable to an integer. The Declaration is a temporary value used as an iterator to refer to list items during processing. It may be passed into the ObjectBody where it will be substituted with the list value used to instantiate each def. llvm-svn: 141232
* Refactor Multiclass Def ProcessingDavid Greene2011-10-051-87/+116
| | | | | | | | Move the code to instantiate a multiclass def, bind its arguments and resolve its members into three helper functions. These will be reused to support a new kind of multiclass def: a multidef. llvm-svn: 141229
* Move TableGen's parser and entry point into a libraryPeter Collingbourne2011-10-011-0/+2163
This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951
OpenPOWER on IntegriCloud