summaryrefslogtreecommitdiff
path: root/lib/TableGen
Commit message (Collapse)AuthorAge
...
* build/CMake: Finish removal of add_llvm_library_dependencies.Daniel Dunbar2011-11-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145420 91177308-0d34-0410-b5e6-96231b3b80d8
* ARM vldm and vstm VFP instructions can take a data type suffix.Jim Grosbach2011-11-11
| | | | | | | | | | | | It's ignored by the assembler when present, but is legal syntax. Other instructions have something similar, but for some mnemonics it's only sometimes not significant, so this quick check in the parser will need refactored into something more robust soon-ish. This gets some basics working in the meantime. Partial for rdar://10435264 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144422 91177308-0d34-0410-b5e6-96231b3b80d8
* build: Add initial cut at LLVMBuild.txt files.Daniel Dunbar2011-11-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement PasteDavid Greene2011-10-19
| | | | | | | | | | | | | | Add a paste operator '#' to take two identifier-like strings and joint them. Internally paste gets represented as a !strconcat() with any necessary casts to string added. This will be used to implement basic for loop functionality as in: for i = [0, 1, 2, 3, 4, 5, 6, 7] { def R#i : Register<...> } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142525 91177308-0d34-0410-b5e6-96231b3b80d8
* Process NAMEDavid Greene2011-10-19
| | | | | | | During multiclass def instantiation, replace NAME in any expressions with the value of the def or defm ID. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142524 91177308-0d34-0410-b5e6-96231b3b80d8
* Process Defm Prefix as InitDavid Greene2011-10-19
| | | | | | | Parse and process a defm prefix as an Init expression. This allows paste operations to create defm prefixes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142523 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse Def ID as ValueDavid Greene2011-10-19
| | | | | | | Allow def and defm IDs to be general values. We need this for paste functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142522 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't Parse Object Body as a NameDavid Greene2011-10-19
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142521 91177308-0d34-0410-b5e6-96231b3b80d8
* Use Parse ModeDavid Greene2011-10-19
| | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142520 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ID Parsing More FlexibleDavid Greene2011-10-19
| | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142519 91177308-0d34-0410-b5e6-96231b3b80d8
* Add NAME MemberDavid Greene2011-10-19
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142518 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Name AccessDavid Greene2011-10-19
| | | | | | Get the Record name as a string explicitly to avoid asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142517 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Name AccessDavid Greene2011-10-19
| | | | | | Get the Record name as a string explicitly to avoid asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142516 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Name AccessDavid Greene2011-10-19
| | | | | | Get the Record name as a string explicitly to avoid asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142515 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Name AccessDavid Greene2011-10-19
| | | | | | Get the Record name by string explicitly to avoid potential asserts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142514 91177308-0d34-0410-b5e6-96231b3b80d8
* Disambiguate Numbers and IdentifiersDavid Greene2011-10-19
| | | | | | | | Use lookahead to determine whether a number is really a number or is part of something forming an identifier. This won't come into play until the paste operator is recognized as a unique token. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142513 91177308-0d34-0410-b5e6-96231b3b80d8
* Add PeekDavid Greene2011-10-19
| | | | | | | | | | | | | Add a peek function to let the Lexer look at a character arbitrarily far ahead in the stream without consuming anything. We need this to disambiguate numbers and operands of a paste operation. For example: def foo#8i Without lookahead the lexer will treat '8' as a number rather than as part of a string to be pasted to form an identifier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142512 91177308-0d34-0410-b5e6-96231b3b80d8
* Resolve Record NamesDavid Greene2011-10-19
| | | | | | | When resolving Record values, be sure to update the Record name as it may contain references to the value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142511 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow Names Changes on Unregistered RecordsDavid Greene2011-10-19
| | | | | | | | | | | Add Record names to be changed even on Records that aren't yet registered. We need to be able to do this for paste functionality because we do not want to register def names before they are unique and that can only happen once all paste operations are done. This change lets us update Record names formed by paste operations and register the result later. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142510 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Name AccessDavid Greene2011-10-19
| | | | | | Ask for the Record name as a string explicitly to avoid a possible assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142506 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Name AccessDavid Greene2011-10-19
| | | | | | | Ask for the Record name as a string explicitly to avoid a possible assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142505 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Name AccessDavid Greene2011-10-19
| | | | | | | Ask for the record name as a string explicitly to avoid a potential assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142504 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Record InitDavid Greene2011-10-19
| | | | | | Add an init function to be shared among Record constructors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142501 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Template Arg Names InitsDavid Greene2011-10-19
| | | | | | | | Allow template arg names to be Inits. This is further work to implement paste as it allows template names to participate in paste operations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142500 91177308-0d34-0410-b5e6-96231b3b80d8
* Let SetValue Take and Init NameDavid Greene2011-10-19
| | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142499 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Utility to Scope NamesDavid Greene2011-10-19
| | | | | | | | Add a couple of utility functions to take a variable name and qualify it with the namespace of the enclosing class and/or multiclass. This is inpreparation for making template arg names first-class Inits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142498 91177308-0d34-0410-b5e6-96231b3b80d8
* Make VarInit Name an InitDavid Greene2011-10-19
| | | | | | | | Make the VarInit name an Init itself. We need this to implement paste functionality so we can reference variables whose names are not yet completely resolved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142497 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Value AccessorsDavid Greene2011-10-19
| | | | | | | | Add accessors to get Record values by Init name. This lets us look up Record values whose names are not yet fully resolved. More work toward paste. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142496 91177308-0d34-0410-b5e6-96231b3b80d8
* Make SMDiagnostic a little more sane. Instead of passing around ↵Chris Lattner2011-10-16
| | | | | | | | | note/warning/error as a string, pass it around as an enum. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142107 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r141079: tblgen: add preprocessor as a separate modeChe-Liang Chiou2011-10-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141492 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove MultidefsDavid Greene2011-10-07
| | | | | | | | | | | | | | | | | | | 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" git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141378 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix List-of-List ProcessingDavid Greene2011-10-06
| | | | | | | | | Fix VarListElementInit::resolveListElementReference to return a partially resolved VarListElementInint in the case where full resolution is not possible. This allows TableGen to make forward progress resolving certain complex list expressions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141315 91177308-0d34-0410-b5e6-96231b3b80d8
* Use StringSwitch.Benjamin Kramer2011-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141305 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code. No functionality change.Benjamin Kramer2011-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141299 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix TypoDavid Greene2011-10-06
| | | | | | | | Compare the entire keyword string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141295 91177308-0d34-0410-b5e6-96231b3b80d8
* Prefix Template Arg Names with Multiclass NameDavid Greene2011-10-05
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141239 91177308-0d34-0410-b5e6-96231b3b80d8
* Process MultidefsDavid Greene2011-10-05
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141233 91177308-0d34-0410-b5e6-96231b3b80d8
* Parser Multidef SupportDavid Greene2011-10-05
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141232 91177308-0d34-0410-b5e6-96231b3b80d8
* Lexer Support for MultidefsDavid Greene2011-10-05
| | | | | | Add keyword support for multidefs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141231 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor Multiclass Def ProcessingDavid Greene2011-10-05
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141229 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix compilation when using gcc-4.6. Patch by wanders.Duncan Sands2011-10-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141178 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace snprintf with raw_string_ostream.Francois Pichet2011-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141116 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow Operator ArgumentsDavid Greene2011-10-04
| | | | | | | | | | | | | | | When resolving an operator list element reference, resolve all operator operands and try to fold the operator first. This allows the operator to collapse to a list which may then be indexed. Before, it was not possible to do this: class D<int a, int b> { ... } class C<list<int> A> : D<A[0], A[1]>; class B<list<int> b> : C<!foreach(...,b)>; Now it is. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141101 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak MSVC build.Francois Pichet2011-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141093 91177308-0d34-0410-b5e6-96231b3b80d8
* tblgen: add preprocessor as a separate modeChe-Liang Chiou2011-10-04
| | | | | | | | | | | | | | | | This patch adds a preprocessor that can expand nested for-loops for saving some copy-n-paste in *.td files. The preprocessor is not yet integrated with TGParser, and so it has no direct effect on *.td inputs. However, you may preprocess an td input (and only preprocess it). To test the proprecessor, type: tblgen -E -o $@ $< git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141079 91177308-0d34-0410-b5e6-96231b3b80d8
* Move TableGen's parser and entry point into a libraryPeter Collingbourne2011-10-01
This is the first step towards splitting LLVM and Clang's tblgen executables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140951 91177308-0d34-0410-b5e6-96231b3b80d8