summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/TGLexer.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move TableGen's parser and entry point into a libraryPeter Collingbourne2011-10-011-435/+0
| | | | | | This is the first step towards splitting LLVM and Clang's tblgen executables. llvm-svn: 140951
* Consolidate some TableGen diagnostic helper functions.Jim Grosbach2011-06-211-11/+1
| | | | | | | TableGen had diagnostic printers sprinkled about in a few places. Pull them together into a single location in Error.cpp. llvm-svn: 133568
* Add new -d option to tblgen. It writes a make(1)-style dependency file.Joerg Sonnenberger2011-06-011-1/+4
| | | | llvm-svn: 132395
* Rename lisp-like functions as suggested by Gabor Greif as loooong timeDavid Greene2011-01-071-3/+3
| | | | | | ago. This is both easier to learn and easier to read. llvm-svn: 123001
* Use this new fangled StringSwitch technology.Bill Wendling2010-12-081-32/+20
| | | | llvm-svn: 121273
* Cleanup table a bit.Bill Wendling2010-12-081-18/+32
| | | | llvm-svn: 121250
* remove the !nameconcat tblgen feature. It "shorthand" and only used in 4 placesChris Lattner2010-10-061-1/+0
| | | | | | where !cast is just as short. llvm-svn: 115722
* when david added support for #NAME# he didn't update the comments andChris Lattner2010-10-051-16/+6
| | | | | | | tried (but failed) to artificially constrain it to working with #NAME#. Just allow any # in identifiers, and update the comments. llvm-svn: 115704
* Push twines deeper into SourceMgr's error handling methods.Benjamin Kramer2010-09-271-3/+4
| | | | llvm-svn: 114847
* Add an !eq() operator to TableGen. It operates on strings only.David Greene2010-01-051-0/+1
| | | | | | Use !cast<string>() to compare other types of objects. llvm-svn: 92754
* Replace std::iostreams with raw_ostream in TableGen.Daniel Dunbar2009-07-031-1/+0
| | | | | | | | - Sorry, I can't help myself. - No intended functionality change. llvm-svn: 74742
* Normalize SourceMgr messages.Daniel Dunbar2009-06-301-2/+2
| | | | | | | | | | | | - Don't print "Parsing" in front of every message. - Take additional "type" argument which is prepended to the message (with ": ") if given. - Update clients to print errors (warnings) as: <filename>:<line number>: error(warning): ... llvm-svn: 74489
* rename SourceMgr::PrintError to PrintMessage.Chris Lattner2009-06-211-2/+2
| | | | llvm-svn: 73861
* simplify some error recovery stuff.Chris Lattner2009-06-211-5/+4
| | | | llvm-svn: 73856
* prune #include, fix warning.Chris Lattner2009-06-211-1/+1
| | | | llvm-svn: 73847
* move include searching logic from TGLexer to SourceMgr.Chris Lattner2009-06-211-13/+4
| | | | llvm-svn: 73845
* Rename TGSourceMgr -> SourceMgr.Chris Lattner2009-06-211-1/+1
| | | | llvm-svn: 73844
* rename TGLoc -> SMLoc.Chris Lattner2009-06-211-7/+7
| | | | llvm-svn: 73843
* move TGSourceMgr class out of TableGen into libsupport.Chris Lattner2009-06-211-1/+1
| | | | llvm-svn: 73842
* Revert 73074 and 73099 because Windows doesn't have POSIXDavid Greene2009-06-091-2/+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/+1
| | | | llvm-svn: 73099
* Add a !regmatch operator to do pattern matching in TableGen.David Greene2009-06-081-0/+1
| | | | llvm-svn: 73074
* Implement !if, analogous to $(if) in GNU make.David Greene2009-05-141-0/+1
| | | | llvm-svn: 71815
* Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.David Greene2009-05-141-0/+3
| | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | 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-1/+1
| | | | llvm-svn: 71794
* Operation EnhancementsDavid Greene2009-05-141-1/+4
| | | | | | | | | | | 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/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | #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
* Implement !nameconcat to concatenate strings and look up the resultingDavid Greene2009-04-221-5/+6
| | | | | | name in the symbol table, returning an object. llvm-svn: 69822
* Fix escaping in asm string literals correctly by having tblgen unescape Chris Lattner2009-03-131-2/+2
| | | | | | them, then the asmprinter emitter reescape them. llvm-svn: 66958
* add a horrible hack to fix the build.Chris Lattner2009-03-131-0/+9
| | | | llvm-svn: 66957
* add support for a few simple escape characters in tblgen strings.Chris Lattner2009-03-131-1/+25
| | | | llvm-svn: 66949
* make "locations" a class instead of a typedef.Chris Lattner2009-03-131-5/+14
| | | | llvm-svn: 66895
* split buffer management and diagnostic printing out of the tblgenChris Lattner2009-03-131-48/+14
| | | | | | lexer into its own TGSourceMgr class. llvm-svn: 66873
* Fun x86 encoding tricks: when adding an immediate value of 128,Dan Gohman2008-10-171-0/+12
| | | | | | | | | | | | | use a SUB instruction instead of an ADD, because -128 can be encoded in an 8-bit signed immediate field, while +128 can't be. This avoids the need for a 32-bit immediate field in this case. A similar optimization applies to 64-bit adds with 0x80000000, with the 32-bit signed immediate field. To support this, teach tablegen how to handle 64-bit constants. llvm-svn: 57663
* Add <cstdio> include where needed by gcc-4.4.Duncan Sands2008-10-081-0/+1
| | | | | | Patch by Samuel Tardieu. llvm-svn: 57291
* Change the MemoryBuffer::getFile* methods to take just a pointer to theChris Lattner2008-04-011-2/+2
| | | | | | | | start of a filename, not a filename+length. All clients can produce a null terminated name, and the system api's require null terminated strings anyway. llvm-svn: 49041
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-0/+2
| | | | | | annoying warnings. llvm-svn: 47367
* remove attributions from utils.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45419
* Rewrite the tblgen parser in a recursive descent style, eliminating the ↵Chris Lattner2007-11-221-139/+87
| | | | | | | | | | | | bison parser. This makes the parser much easier to understand, eliminates a ton of global variables, and gives tblgen nice caret diagnostics. It is also faster, but tblgen probably doesn't care about performance. There are a couple of FIXMEs which I will take care of next. llvm-svn: 44274
* Switching back to strtoll. Including config.h. On VStudio builds, this ↵Chuck Rose III2007-11-211-3/+4
| | | | | | overrides strtoll. llvm-svn: 44264
* This change does a couple of things. First it gets the Visual Studio builds ↵Chuck Rose III2007-11-211-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | working. I added the lexing files to the VStudio projects and removed the .l files from the VStudio projects. There was a problem with use of strtoll in TGLexer.cpp and Chris suggested switching to strtol, so that's included here. Additionally, this checkin adds minimal x64 builds to the VStudio builds. Build issues related to x64 in the windows specific files for DynamicLibrary.inc and Singals.inc are worked around, but not ultimately solved. Binaries used to be stored in ...\win32\{Debug|Release} but are now kept in ...\win32\bin\{win32|x64}\{Debug|Release} intermediate files will continue to be stored in the individual project directories under win32. Some names will likely change in the future to reflect that the vstudio projects are no longer 32-bit only, but I wanted to get things up and running today so kept away from bigger restructuring. llvm-svn: 44260
* Record the start of the current token, for use in error reporting.Chris Lattner2007-11-191-5/+6
| | | | llvm-svn: 44227
* Add carat diagnostics to tblgen lexer errors.Chris Lattner2007-11-191-28/+53
| | | | llvm-svn: 44226
* minor cleanupsChris Lattner2007-11-181-2/+2
| | | | llvm-svn: 44212
* ensure header is self contained.Chris Lattner2007-11-181-1/+1
| | | | llvm-svn: 44211
* reimplement the tblgen lexer with a simple hand-written lexer. This eliminatesChris Lattner2007-11-181-0/+439
one dependency on flex and gets rid of two ".cvs" files. llvm-svn: 44210
OpenPOWER on IntegriCloud