summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/Record.h
Commit message (Collapse)AuthorAgeFilesLines
* Move TableGen's parser and entry point into a libraryPeter Collingbourne2011-10-011-1656/+0
| | | | | | This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951
* Make RecordVal Name an InitDavid Greene2011-09-021-2/+3
| | | | | | | | | Store a RecordVal's name as an Init to allow class-qualified Record members to reference Records that have Init names. We'll use this to provide more programmability in how we name defs and their associated members. llvm-svn: 139031
* Make Record Name an InitDavid Greene2011-08-101-3/+6
| | | | | | | | | | | Use an Init (ultimately a StringInit) to represent the Record name. This allows the name to be composed by standard TableGen operators. This will enable us to get rid of the ugly #NAME# hack processing and naturally replace it with operators. It also increases flexibility and power of the TableGen language by allowing record identifiers to be computed dynamically. llvm-svn: 137232
* Add getAsUnquotedStringDavid Greene2011-08-101-0/+6
| | | | | | | | | | | Add a method to return an Init as an unquoted string. This primarily affects StringInit where we return the value without surrounding it with quotes. This is in preparation for removing the ugly #NAME# hack and replacing it with standard TabelGen operators. llvm-svn: 137231
* Unconstify InitsDavid Greene2011-07-291-330/+327
| | | | | | Remove const qualifiers from Init references, per Chris' request. llvm-svn: 136531
* [AVX] Make DagInits UniqueDavid Greene2011-07-291-18/+10
| | | | | | Make sure DagInits are unique and created only once. llvm-svn: 136501
* [AVX] Make ListInits UniqueDavid Greene2011-07-291-5/+5
| | | | | | | | | Ensure ListInits are unique and only created once. This will be important for AVX as lists will be used extensively to pass generic patterns, prefix information and other things to lower-level pattern-generation classes. llvm-svn: 136493
* [AVX] Make BitsInit UniqueDavid Greene2011-07-291-3/+4
| | | | | | Make BitsInit a FoldingSetNode so we can unique it. llvm-svn: 136489
* [AVX] Create Inits Via Factory MethodDavid Greene2011-07-291-34/+156
| | | | | | | Replace uses of new *Init with *Init::get. This hides the allocation implementation so that we can unique Inits in various ways. llvm-svn: 136486
* [AVX] Constify InitsDavid Greene2011-07-291-286/+298
| | | | | | | Make references to Inits const everywhere. This is the final step before making them unique. llvm-svn: 136485
* [AVX] Remove non-const IteratorsDavid Greene2011-07-291-11/+2
| | | | | | | | Remove all non-const iterators from Init classes. This is another step toward constifying Inits and ultimately turning them into FoldingSetNodes. llvm-svn: 136484
* [AVX] Remove Mutating Members from InitsDavid Greene2011-07-291-10/+1
| | | | | | | Get rid of all Init members that modify internal state. This is in preparation for making references to Inits const. llvm-svn: 136483
* Add ListInit::getValuesDavid Greene2011-07-291-0/+3
| | | | | | | Add a getValues ListInit method to return the sequence of values in the list. llvm-svn: 136482
* Intern all RecTy subclass instances to avoid duplicates.Jakob Stoklund Olesen2011-07-181-13/+50
| | | | | | | | | | | | | | | | | Make all of the RecTy constructors private, and use get() factory methods instead. Return singleton instances when it makes sense. ListTy instance pointers are stored in the element RecTy instance. BitsRecTy instance pointers, one per length, are stored in a static vector. Also unique DefInit instances. A Record has a unique DefInit which has a unique RecordRecTy instance. This saves some 200k-300k RecTy allocations when parsing ARM.td. It reduces TableGen's heap usage by almost 50%. llvm-svn: 135399
* struct Init -> class InitDavid Greene2011-07-131-2/+3
| | | | | | | Rename struct Init to class Init for consistency and in preparation for making Init a FoldingSetNode. llvm-svn: 135097
* Revert r134921, 134917, 134908 and 134907. They're causing failuresEric Christopher2011-07-111-653/+323
| | | | | | in multiple buildbots. llvm-svn: 134936
* Use get(0 Instead of Create()David Greene2011-07-111-32/+32
| | | | | | Respond to some feedback asking for a name change. llvm-svn: 134921
* struct Init -> class Init.Evan Cheng2011-07-111-1/+1
| | | | llvm-svn: 134917
* [AVX] Make Inits FoldableDavid Greene2011-07-111-322/+652
| | | | | | | | | | | | | | | | | | Manage Inits in a FoldingSet. This provides several benefits: - Memory for Inits is properly managed - Duplicate Inits are folded into Flyweights, saving memory - It enforces const-correctness, protecting against certain classes of bugs The above benefits allow Inits to be used in more contexts, which in turn provides more dynamism to TableGen. This enhanced capability will be used by the AVX code generator to a fold common patterns together. llvm-svn: 134907
* Add support for alternative register names, useful for instructions whose ↵Owen Anderson2011-06-271-0/+6
| | | | | | | | operands are logically equivalent to existing registers, but happen to be printed specially. For example, an instruciton that prints d0[0] instead of s0. Patch by Jim Grosbach. llvm-svn: 133940
* Consolidate some TableGen diagnostic helper functions.Jim Grosbach2011-06-211-14/+0
| | | | | | | TableGen had diagnostic printers sprinkled about in a few places. Pull them together into a single location in Error.cpp. llvm-svn: 133568
* now that predicates have a decent abstraction layer on them, introduce a new Chris Lattner2011-04-171-1/+1
| | | | | | | | | kind of predicate: one that is specific to imm nodes. The predicate function specified here just checks an int64_t directly instead of messing around with SDNode's. The virtue of this is that it means that fastisel and other things can reason about these predicates. llvm-svn: 129675
* Rename lisp-like functions as suggested by Gabor Greif as loooong timeDavid Greene2011-01-071-1/+1
| | | | | | ago. This is both easier to learn and easier to read. llvm-svn: 123001
* various cleanups to tblgen, patch by Garrison Venn!Chris Lattner2010-12-151-9/+3
| | | | llvm-svn: 121837
* Add support for using the `!if' operator when initializing variables:Bill Wendling2010-12-131-0/+2
| | | | | | | | | | | class A<bit a, bits<3> x, bits<3> y> { bits<3> z; let z = !if(a, x, y); } The variable z will get the value of x when 'a' is 1 and 'y' when a is '0'. llvm-svn: 121666
* eliminate the Records global variable, patch by Garrison Venn!Chris Lattner2010-12-131-5/+19
| | | | llvm-svn: 121659
* I swear I did a make clean and make before committing all this...Michael J. Spencer2010-11-291-1/+1
| | | | llvm-svn: 120304
* remove the !nameconcat tblgen feature. It "shorthand" and only used in 4 placesChris Lattner2010-10-061-1/+1
| | | | | | where !cast is just as short. llvm-svn: 115722
* Push twines deeper into SourceMgr's error handling methods.Benjamin Kramer2010-09-271-1/+1
| | | | llvm-svn: 114847
* Trailing whitespace, 80-col violations.Mikhail Glushenkov2010-09-211-6/+6
| | | | llvm-svn: 114435
* Generalize getFieldType to work on all TypedInits. Add a couple of ↵David Greene2010-09-031-6/+6
| | | | | | | | testcases from Amaury Pouly. llvm-svn: 113010
* Add StringRef::compare_numeric and use it to sort TableGen register records.Jakob Stoklund Olesen2010-05-261-1/+1
| | | | | | | This means that our Registers are now ordered R7, R8, R9, R10, R12, ... Not R1, R10, R11, R12, R2, R3, ... llvm-svn: 104745
* If all the bit positions are not specified; do not decode the instructions.Johnny Chen2010-04-091-0/+5
| | | | | | | | | | We are bound to fail! For proper disassembly, the well-known encoding bits of the instruction must be fully specified. This also removes pseudo instructions from considerations of disassembly, which is a better design and less fragile than the name matchings. llvm-svn: 100899
* Replace TSFlagsFields and TSFlagsShifts with a simpler TSFlags field.Jakob Stoklund Olesen2010-04-051-3/+0
| | | | | | | | | | | | | | | | | | | When a target instruction wants to set target-specific flags, it should simply set bits in the TSFlags bit vector defined in the Instruction TableGen class. This works well because TableGen resolves member references late: class I : Instruction { AddrMode AM = AddrModeNone; let TSFlags{3-0} = AM.Value; } let AM = AddrMode4 in def ADD : I; TSFlags gets the expected bits from AddrMode4 in this example. llvm-svn: 100384
* Teach TableGen to understand X.Y notation in the TSFlagsFields strings.Jakob Stoklund Olesen2010-03-251-0/+3
| | | | | | | Remove much horribleness from X86InstrFormats as a result. Similar simplifications are probably possible for other targets. llvm-svn: 99539
* Fix evil TableGen bug in template parameters with defaults.Jakob Stoklund Olesen2010-03-251-3/+6
| | | | | | | | | | If a TableGen class has an initializer expression containing an X.Y subexpression, AND X depends on template parameters, AND those template parameters have defaults, AND some parameters with defaults are beyond position 1, THEN parts of the initializer expression are evaluated prematurely with the default values when the first explicit template parameter is substituted, before the remaining explicit template parameters have been substituted. llvm-svn: 99492
* Fix PR2590 by making PatternSortingPredicate actually be Chris Lattner2010-03-011-0/+4
| | | | | | | | | | | | | | | ordered correctly. Previously it would get in trouble when two patterns were too similar and give them nondet ordering. We force this by using the record ID order as a fallback. The testsuite diff is due to alpha patterns being ordered slightly differently, the change is a semantic noop afaict: < lda $0,-100($16) --- > subq $16,100,$0 llvm-svn: 97509
* Add an !eq() operator to TableGen. It operates on strings only.David Greene2010-01-051-1/+1
| | | | | | Use !cast<string>() to compare other types of objects. llvm-svn: 92754
* Delete some dead and non-obvious code.Dan Gohman2009-11-241-6/+0
| | | | llvm-svn: 89729
* Fix whitespace.Bob Wilson2009-11-221-37/+32
| | | | llvm-svn: 89582
* Fix some spelling in comments.Bob Wilson2009-11-211-1/+1
| | | | llvm-svn: 89566
* Avoid a redundant assertion.Bob Wilson2009-11-211-2/+1
| | | | llvm-svn: 89565
* Move DataTypes.h to include/llvm/System, update all users. This breaks the lastChandler Carruth2009-10-261-1/+1
| | | | | | direct inclusion edge from System to Support. llvm-svn: 85086
* convert some stuff to StringRef to avoid temporary std::strings.Chris Lattner2009-09-181-17/+17
| | | | llvm-svn: 82244
* Fix non-determinism in DAGISel emitter.Daniel Dunbar2009-08-231-1/+8
| | | | | | | | | | | | | | | | | | | | | | | - This manifested as non-determinism in the .inc output in rare cases (when two distinct patterns ended up being equivalent, which is rather rare). That meant the pattern matching was non-deterministic, which could eventually mean the code generator selected different instructions based on the arch. - It's probably worth making the DAGISel ensure a total ordering (or force the user to), but the simple fix here is to totally order the Record* maps based on a unique ID. - PR4672, PR4711. Yay: -- ddunbar@giles:~$ cat ~/llvm.obj.64/lib/Target/*/*.inc | shasum d1099ff34b21459a5a3e7021c225c080e6017ece - ddunbar@giles:~$ cat ~/llvm.obj.ppc/lib/Target/*/*.inc | shasum d1099ff34b21459a5a3e7021c225c080e6017ece - -- llvm-svn: 79846
* This void is implicit in C++.Dan Gohman2009-08-121-4/+4
| | | | llvm-svn: 78848
* Replace std::iostreams with raw_ostream in TableGen.Daniel Dunbar2009-07-031-13/+14
| | | | | | | | - Sorry, I can't help myself. - No intended functionality change. llvm-svn: 74742
* Implement !cast<string>.David Greene2009-06-291-0/+6
| | | | llvm-svn: 74444
* rename TGLoc -> SMLoc.Chris Lattner2009-06-211-8/+8
| | | | llvm-svn: 73843
* move TGSourceMgr class out of TableGen into libsupport.Chris Lattner2009-06-211-1/+1
| | | | llvm-svn: 73842
OpenPOWER on IntegriCloud