summaryrefslogtreecommitdiffstats
path: root/llvm/lib/TableGen/TGLexer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* TableGen: Add !ne, !le, !lt, !ge, and !gt comparisonsNicolai Haehnle2018-03-141-0/+5
| | | | | | | | Change-Id: I8e2ece677268972d578a787467f7ef52a1f33a71 Differential revision: https://reviews.llvm.org/D44114 llvm-svn: 327496
* TableGen: Add !dag function for constructionNicolai Haehnle2018-03-141-0/+1
| | | | | | | | | | | | | | | This allows constructing DAG nodes with programmatically determined names, and can simplify constructing DAG nodes in other cases as well. Also, add documentation and some very simple tests for the already existing !con. Change-Id: Ida61cd82e99752548d7109ce8da34d29da56a5f7 Differential revision: https://reviews.llvm.org/D44110 llvm-svn: 327492
* TableGen: Remove space at EOL in TGLexer.{h,cpp}Nicolai Haehnle2018-03-091-25/+25
| | | | | Change-Id: Ica5f39470174e85f173d3b6db95789033f75ce17 llvm-svn: 327158
* TableGen: Add a defset statementNicolai Haehnle2018-03-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Allows capturing a list of concrete instantiated defs. This can be combined with foreach to create parallel sets of def instantiations with less repetition in the source. This purpose is largely also served by multiclasses, but in some cases multiclasses can't be used. The motivating example for this change is having a large set of intrinsics, which are generated from the IntrinsicsBackend.td file included by Intrinsics.td, and a corresponding set of instruction selection patterns, which are generated via the backend's .td files. Multiclasses cannot be used to eliminate the redundancy in this case, because a multiclass cannot span both LLVM's common .td files and the backend .td files at the same time. Change-Id: I879e35042dceea542a5e6776fad23c5e0e69e76b Differential revision: https://reviews.llvm.org/D44109 llvm-svn: 327121
* TableGen: add !isa operationNicolai Haehnle2018-03-091-0/+1
| | | | | | | | Change-Id: Iddb724c3ae706d82933a2d82c91d07e0e36b30e3 Differential revision: https://reviews.llvm.org/D44105 llvm-svn: 327117
* TableGen: Add !foldl operationNicolai Haehnle2018-03-061-0/+1
| | | | | Change-Id: I63d67bf6e0b315e2d3360e47e3b62c9517f38987 llvm-svn: 326790
* TableGen: Add !size operationNicolai Haehnle2018-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Returns the size of a list. I have found this to be rather useful in some development for the AMDGPU backend where we could simplify our .td files by concatenating list<LLVMType> for complex intrinsics. Doing so requires us to compute the position argument for LLVMMatchType. Basically, the usage is in a pattern that looks somewhat like this: list<LLVMType> argtypes = !listconcat(base, [llvm_any_ty, LLVMMatchType<!size(base)>]); Change-Id: I360a0b000fd488d18bea412228230fd93722bd2c Reviewers: arsenm, craig.topper, tra, MartinO Subscribers: wdng, llvm-commits, tpr Differential Revision: https://reviews.llvm.org/D43553 llvm-svn: 325883
* TableGen: Add operator !orMatt Arsenault2016-11-151-0/+1
| | | | llvm-svn: 286936
* Fix some Clang-tidy modernize-use-using and Include What You Use warnings; ↵Eugene Zelenko2016-08-231-6/+5
| | | | | | | | other minor fixes. Differential revision: https://reviews.llvm.org/D23789 llvm-svn: 279535
* Replace a few more "fall through" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-171-1/+1
| | | | | | Follow up to r278902. I had missed "fall through", with a space. llvm-svn: 278970
* Replace "fallthrough" comments with LLVM_FALLTHROUGHJustin Bogner2016-08-171-1/+1
| | | | | | | This is a mechanical change of comments in switches like fallthrough, fall-through, or fall-thru to use the LLVM_FALLTHROUGH macro instead. llvm-svn: 278902
* Change TableGen so that binary literals such as 0b001 are now sized.Pete Cooper2014-08-071-1/+1
| | | | | | | | | | | | | | | | | Instead of these becoming an integer literal internally, they now become bits<n> values. Prior to this change, 0b001 was 1 bit long. This is confusing as clearly the user gave 3 bits. This new type holds both the literal value and the size, and so can ensure sizes match on initializers. For example, this used to be legal bits<1> x = 0b00; but now it must be written as bits<2> x = 0b00; llvm-svn: 215084
* Allow binary and for tblgen math.Joerg Sonnenberger2014-08-051-0/+1
| | | | llvm-svn: 214851
* This only needs a StringRef.Rafael Espindola2014-07-061-9/+9
| | | | llvm-svn: 212402
* SourceMgr: make valid buffer IDs start from oneAlp Toker2014-07-061-2/+2
| | | | | | | | | | Use 0 for the invalid buffer instead of -1/~0 and switch to unsigned representation to enable more idiomatic usage. Also introduce a trivial SourceMgr::getMainFileID() instead of hard-coding 0/1 to identify the main file. llvm-svn: 212398
* [tablegen] Add !listconcat operator with the similar semantics as !strconcatDaniel Sanders2014-05-071-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: It concatenates two or more lists. In addition to the !strconcat semantics the lists must have the same element type. My overall aim is to make it easy to append to Instruction.Predicates rather than override it. This can be done by concatenating lists passed as arguments, or by concatenating lists passed in additional fields. Reviewers: dsanders Reviewed By: dsanders Subscribers: hfinkel, llvm-commits Differential Revision: http://reviews.llvm.org/D3506 llvm-svn: 208183
* [C++11] Make use of 'nullptr' in TableGen library.Craig Topper2014-04-091-5/+5
| | | | llvm-svn: 205830
* tblgen: Diagnose duplicate includes.Sean Silva2013-02-071-1/+9
| | | | | | | | | | | | | | | 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. llvm-svn: 174582
* Add an addition operator to TableGenHal Finkel2013-01-251-0/+1
| | | | | | | This adds an !add(a, b) operator to tablegen; this will be used to cleanup the PPC register definitions. llvm-svn: 173445
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-6/+5
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Add Foreach LoopDavid Greene2012-02-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 151164
* TableGen: add a commentDylan Noblesmith2011-12-221-1/+1
| | | | llvm-svn: 147199
* try to fix MSVC buildDylan Noblesmith2011-12-221-0/+3
| | | | llvm-svn: 147198
* drop unneeded config.h includesDylan Noblesmith2011-12-221-1/+0
| | | | llvm-svn: 147197
* Implement PasteDavid Greene2011-10-191-5/+5
| | | | | | | | | | | | | | 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<...> } llvm-svn: 142525
* Disambiguate Numbers and IdentifiersDavid Greene2011-10-191-1/+37
| | | | | | | | 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. llvm-svn: 142513
* Add PeekDavid Greene2011-10-191-0/+4
| | | | | | | | | | | | | 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. llvm-svn: 142512
* Remove MultidefsDavid Greene2011-10-071-1/+0
| | | | | | | | | | | | | | | | | | | 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
* Use StringSwitch.Benjamin Kramer2011-10-061-19/+21
| | | | llvm-svn: 141305
* Simplify code. No functionality change.Benjamin Kramer2011-10-061-26/+24
| | | | llvm-svn: 141299
* Fix TypoDavid Greene2011-10-061-1/+1
| | | | | | Compare the entire keyword string. llvm-svn: 141295
* Lexer Support for MultidefsDavid Greene2011-10-051-0/+1
| | | | | | Add keyword support for multidefs. llvm-svn: 141231
* Move TableGen's parser and entry point into a libraryPeter Collingbourne2011-10-011-0/+435
This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951
OpenPOWER on IntegriCloud