summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/TGParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move TableGen's parser and entry point into a libraryPeter Collingbourne2011-10-011-2163/+0
| | | | | | This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951
* Better Error ReportingDavid Greene2011-09-191-0/+4
| | | | | | | Report missing template arguments more helpfully by supplying the name of the missing argument in the error message. llvm-svn: 140034
* Make Record Name an InitDavid Greene2011-08-101-0/+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
* Unconstify InitsDavid Greene2011-07-291-58/+58
| | | | | | Remove const qualifiers from Init references, per Chris' request. llvm-svn: 136531
* [AVX] Create Inits Via Factory MethodDavid Greene2011-07-291-17/+17
| | | | | | | 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-60/+60
| | | | | | | Make references to Inits const everywhere. This is the final step before making them unique. llvm-svn: 136485
* [AVX] Remove Mutating Members from InitsDavid Greene2011-07-291-9/+10
| | | | | | | Get rid of all Init members that modify internal state. This is in preparation for making references to Inits const. llvm-svn: 136483
* Intern all RecTy subclass instances to avoid duplicates.Jakob Stoklund Olesen2011-07-181-23/+23
| | | | | | | | | | | | | | | | | 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
* Revert r134921, 134917, 134908 and 134907. They're causing failuresEric Christopher2011-07-111-84/+82
| | | | | | in multiple buildbots. llvm-svn: 134936
* Use get(0 Instead of Create()David Greene2011-07-111-18/+18
| | | | | | Respond to some feedback asking for a name change. llvm-svn: 134921
* [AVX] Make Inits FoldableDavid Greene2011-07-111-82/+84
| | | | | | | | | | | | | | | | | | 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 missing 'return on failure'. Previously we'd crash after emittingJim Grosbach2011-03-111-0/+1
| | | | | | the diagnostic. llvm-svn: 127480
* Rename lisp-like functions as suggested by Gabor Greif as loooong timeDavid Greene2011-01-071-19/+19
| | | | | | 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-5/+6
| | | | llvm-svn: 121837
* Add support for using the `!if' operator when initializing variables:Bill Wendling2010-12-131-8/+36
| | | | | | | | | | | 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/+7
| | | | llvm-svn: 121659
* fix a crash on:Chris Lattner2010-10-311-1/+2
| | | | | | | | | | | | let Constraints = "$val = $dst", Defs = [EFLAGS] in, isCodeGenOnly = 1 { we now get: X86InstrCompiler.td:653:52: error: Expected class, def, defm, multiclass or let definition let Constraints = "$val = $dst", Defs = [EFLAGS] in, isCodeGenOnly = 1 { ^ llvm-svn: 117863
* fix the !eq operator in tblgen to return a bit instead of an int.Chris Lattner2010-10-311-1/+1
| | | | | | | | Use this to make the X86 and ARM targets set isCodeGenOnly=1 automatically for their instructions that have Format=Pseudo, resolving a hack in tblgen. llvm-svn: 117862
* Remove -llvmc-temp-hack from tblgen.Mikhail Glushenkov2010-10-231-17/+1
| | | | llvm-svn: 117197
* Trailing whitespace.Mikhail Glushenkov2010-10-231-6/+6
| | | | llvm-svn: 117195
* Generalize tblgen's dag parsing logic to handle arbitrary expressionsChris Lattner2010-10-061-5/+18
| | | | | | | | | | | | | | as the operator of the dag. Specifically, this allows parsing things like (F.x 4) in addition to just (a 4). Unfortunately, this runs afoul of an idiom being used by llvmc. It is using dags like (foo [1,2,3]) to represent a list of stuff being passed into foo. With this change, this is parsed as a [1,2,3] subscript on foo instead of being the first argument to the dag. Cope with this in the short term by requiring a "-llvmc-temp-hack" argument to tblgen to get the old parsing behavior. llvm-svn: 115742
* cleanupsChris Lattner2010-10-061-9/+10
| | | | llvm-svn: 115739
* remove the !nameconcat tblgen feature. It "shorthand" and only used in 4 placesChris Lattner2010-10-061-35/+9
| | | | | | where !cast is just as short. llvm-svn: 115722
* allow !strconcat to take more than two operands to eliminateChris Lattner2010-10-051-23/+34
| | | | | | | | !strconcat(!strconcat(!strconcat(!strconcat Simplify some x86 td files to use it. llvm-svn: 115719
* enhance tblgen to support anonymous defm's, use this toChris Lattner2010-10-051-18/+31
| | | | | | simplify the X86 CMOVmr's. llvm-svn: 115702
* Fix a subtle multiclass bug: when using class inheritance onBruno Cardoso Lopes2010-06-221-4/+4
| | | | | | a toplevel 'defm', make sure to properly resolve references. llvm-svn: 106570
* Teach tablegen how to inherit from classes in 'defm' definitions.Bruno Cardoso Lopes2010-06-181-0/+50
| | | | | | | The rule is simple: only inherit from a class list if they come in the end, after the last multiclass. llvm-svn: 106305
* Teach tablegen to allow "let" expressions inside multiclasses,Bruno Cardoso Lopes2010-06-101-47/+38
| | | | | | providing more ways to factor out commonality from the records. llvm-svn: 105776
* Teach tablegen to support 'defm' inside multiclasses.Bruno Cardoso Lopes2010-06-051-9/+41
| | | | llvm-svn: 105519
* Add an !eq() operator to TableGen. It operates on strings only.David Greene2010-01-051-0/+7
| | | | | | Use !cast<string>() to compare other types of objects. llvm-svn: 92754
* Fix whitespace.Bob Wilson2009-11-221-195/+184
| | | | llvm-svn: 89582
* This void is implicit in C++.Dan Gohman2009-08-121-1/+1
| | | | llvm-svn: 78848
* Replace std::iostreams with raw_ostream in TableGen.Daniel Dunbar2009-07-031-6/+4
| | | | | | | | - Sorry, I can't help myself. - No intended functionality change. llvm-svn: 74742
* Improve TableGen error reporting.David Greene2009-06-291-1/+5
| | | | llvm-svn: 74443
* rename TGLoc -> SMLoc.Chris Lattner2009-06-211-20/+20
| | | | llvm-svn: 73843
* Revert 73074 and 73099 because Windows doesn't have POSIXDavid Greene2009-06-091-16/+0
| | | | | | | regular expressions. We will add an OpenBSD implementation and re-apply ASAP. llvm-svn: 73138
* Add a !patsubst operator. Use on string types.David Greene2009-06-081-0/+9
| | | | llvm-svn: 73099
* Make IntInits and ListInits typed. This helps deduce types of !if andDavid Greene2009-06-081-25/+140
| | | | | | | | other operators. For the rare cases where a list type cannot be deduced, provide a []<type> syntax, where <type> is the list element type. llvm-svn: 73078
* Add a !regmatch operator to do pattern matching in TableGen.David Greene2009-06-081-0/+7
| | | | llvm-svn: 73074
* Implement !if, analogous to $(if) in GNU make.David Greene2009-05-141-0/+24
| | | | llvm-svn: 71815
* Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.David Greene2009-05-141-1/+74
| | | | | | | | | | Ok, not really, but do support some common LISP functions: * car * cdr * null llvm-svn: 71805
* Implement a !foreach operator analogous to GNU make's $(foreach).David Greene2009-05-141-14/+14
| | | | | | | | | | | | | | Use it on dags and lists like this: class decls { string name; } def Decls : decls; class B<list<string> names> : A<!foreach(Decls.name, names, !strconcat(Decls.name, ", Sr."))>; llvm-svn: 71803
* Implement a !subst operation simmilar to $(subst) in GNU make to doDavid Greene2009-05-141-72/+72
| | | | | | | | | | | | | | | | def/var/string substitution on generic pattern templates. For example: def Type; def v4f32 : Type; def TYPE : Type; class GenType<Type t> { let type = !(subst TYPE, v4f32, t); } def TheType : GenType<TYPE>; llvm-svn: 71801
* Implement !cast.David Greene2009-05-141-31/+31
| | | | llvm-svn: 71794
* Operation EnhancementsDavid Greene2009-05-141-126/+241
| | | | | | | | | | | Create an OpInit class to serve as a base for all operation Inits. Move parsing of operation constructs to separate functions and reference from multiple places. Add some commented out new operations. Coming soon. llvm-svn: 71789
* Allow multiclass def names to contain "#NAME"" where TableGen replacesDavid Greene2009-05-051-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #NAME# with the name of the defm instantiating the multiclass. This is useful for AVX instruction naming where a "V" prefix is standard throughout the ISA. For example: multiclass SSE_AVX_Inst<...> { def SS : Instr<...>; def SD : Instr<...>; def PS : Instr<...>; def PD : Instr<...>; def V#NAME#SS : Instr<...>; def V#NAME#SD : Instr<...>; def V#NAME#PS : Instr<...>; def V#NAME#PD : Instr<...>; } defm ADD : SSE_AVX_Inst<...>; Results in ADDSS ADDSD ADDPS ADDPD VADDSS VADDSD VADDPS VADDPD llvm-svn: 70979
* Rename the CurMultiClass formal parameter of TGParser::AddSubMultiClassBob Wilson2009-04-301-8/+8
| | | | | | | so that it doesn't shadow the instance variable of the same name. Make the parameter names in method declarations match the definitions. llvm-svn: 70502
* Remove unnecessary "class" keywords.Bob Wilson2009-04-301-1/+1
| | | | llvm-svn: 70499
* Fix trailing whitespace and 80-col. violations in recent TableGen changes.Bob Wilson2009-04-281-27/+34
| | | | llvm-svn: 70319
* Fix multiclass inheritance to limit value resolution to new defs addedDavid Greene2009-04-241-20/+59
| | | | | | | by base multiclasses. Do not attempt to alter defs from previous base multiclasses. This fixes multiple multiclass inheritance. llvm-svn: 69974
OpenPOWER on IntegriCloud