summaryrefslogtreecommitdiff
path: root/lib/TableGen/TGParser.h
Commit message (Collapse)AuthorAge
* tblgen: Diagnose duplicate includes.Sean Silva2013-02-07
| | | | | | | | | | | | | | | A double inclusion will pretty much always be an error in TableGen, so there's no point going on just to die with "def already defined" or whatnot. I'm not too thrilled about the "public: ... private: ..." to expose the DependenciesMapTy, but I really didn't see a better way to keep that type centralized. It's a smell that indicates that some refactoring is needed to make this code more loosely coupled. This should avoid all bugs of the same nature as PR15189. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174582 91177308-0d34-0410-b5e6-96231b3b80d8
* TableGen: Keep track of superclass reference ranges.Jordan Rose2013-01-10
| | | | | | | | | | def foo : bar; ~~~ This allows us to produce more precise diagnostics about a certain superclass, and even provide fixits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172085 91177308-0d34-0410-b5e6-96231b3b80d8
* tblgen: Factor out common code.Sean Silva2013-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171951 91177308-0d34-0410-b5e6-96231b3b80d8
* Inline this into its only caller.Sean Silva2013-01-09
| | | | | | | | | | | It's clearer and additionally this gets rid of the usage of `DefmID`, which doesn't really correspond to anything in the language (it was just used in the name of this parsing function which parsed a `MultiClassID` and returned that multiclass's record). This area of the code still needs a lot of work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171938 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort includes for all of the .h files under the 'lib' tree. These wereChandler Carruth2012-12-04
| | | | | | | | | | missed in the first pass because the script didn't yet handle include guards. Note that the script is now able to handle all of these headers without manual edits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169224 91177308-0d34-0410-b5e6-96231b3b80d8
* tblgen: Whitespace and 80-col cleanup.Sean Silva2012-10-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165190 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify TGParser::ProcessForEachDefs.Jakob Stoklund Olesen2012-05-24
| | | | | | Use static type checking. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157430 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove stray semi-colon.Daniel Dunbar2012-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151629 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Foreach LoopDavid Greene2012-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some data structures to represent for loops. These will be referenced during object processing to do any needed iteration and instantiation. Add foreach keyword support to the lexer. Add a mode to indicate that we're parsing a foreach loop. This allows the value parser to early-out when processing the foreach value list. Add a routine to parse foreach iteration declarations. This is separate from ParseDeclaration because the type of the named value (the iterator) doesn't match the type of the initializer value (the value list). It also needs to add two values to the foreach record: the iterator and the value list. Add parsing support for foreach. Add the code to process foreach loops and create defs based on iterator values. Allow foreach loops to be matched at the top level. When parsing an IDValue check if it is a foreach loop iterator for one of the active loops. If so, return a VarInit for it. Add Emacs keyword support for foreach. Add VIM keyword support for foreach. Add tests to check foreach operation. Add TableGen documentation for foreach. Support foreach with multiple objects. Support non-braced foreach body with one object. Do not require types for the foreach declaration. Assume the iterator type from the iteration list element type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151164 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
* 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
* 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
* 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
* 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
* 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
* 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