aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TableGen/TGLexer.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-08-23Fix some Clang-tidy modernize-use-using and Include What You Use warnings; ↵Eugene Zelenko1-6/+5
other minor fixes. Differential revision: https://reviews.llvm.org/D23789 llvm-svn: 279535
2016-08-17Replace a few more "fall through" comments with LLVM_FALLTHROUGHJustin Bogner1-1/+1
Follow up to r278902. I had missed "fall through", with a space. llvm-svn: 278970
2016-08-17Replace "fallthrough" comments with LLVM_FALLTHROUGHJustin Bogner1-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
2014-08-07Change TableGen so that binary literals such as 0b001 are now sized.Pete Cooper1-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
2014-08-05Allow binary and for tblgen math.Joerg Sonnenberger1-0/+1
llvm-svn: 214851
2014-07-06This only needs a StringRef.Rafael Espindola1-9/+9
llvm-svn: 212402
2014-07-06SourceMgr: make valid buffer IDs start from oneAlp Toker1-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
2014-05-07[tablegen] Add !listconcat operator with the similar semantics as !strconcatDaniel Sanders1-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
2014-04-09[C++11] Make use of 'nullptr' in TableGen library.Craig Topper1-5/+5
llvm-svn: 205830
2013-02-07tblgen: Diagnose duplicate includes.Sean Silva1-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
2013-01-25Add an addition operator to TableGenHal Finkel1-0/+1
This adds an !add(a, b) operator to tablegen; this will be used to cleanup the PPC register definitions. llvm-svn: 173445
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth1-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
2012-02-22Add Foreach LoopDavid Greene1-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
2011-12-22TableGen: add a commentDylan Noblesmith1-1/+1
llvm-svn: 147199
2011-12-22try to fix MSVC buildDylan Noblesmith1-0/+3
llvm-svn: 147198
2011-12-22drop unneeded config.h includesDylan Noblesmith1-1/+0
llvm-svn: 147197
2011-10-19Implement PasteDavid Greene1-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
2011-10-19Disambiguate Numbers and IdentifiersDavid Greene1-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
2011-10-19Add PeekDavid Greene1-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
2011-10-07Remove MultidefsDavid Greene1-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
2011-10-06Use StringSwitch.Benjamin Kramer1-19/+21
llvm-svn: 141305
2011-10-06Simplify code. No functionality change.Benjamin Kramer1-26/+24
llvm-svn: 141299
2011-10-06Fix TypoDavid Greene1-1/+1
Compare the entire keyword string. llvm-svn: 141295
2011-10-05Lexer Support for MultidefsDavid Greene1-0/+1
Add keyword support for multidefs. llvm-svn: 141231
2011-10-01Move TableGen's parser and entry point into a libraryPeter Collingbourne1-0/+435
This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951