Chris Lattner
84846b71af
remove the !nameconcat tblgen feature. It "shorthand" and only used in 4 places
...
where !cast is just as short.
llvm-svn: 115722
2010-10-06 00:19:21 +00:00
Benjamin Kramer
cd6c025b08
Push twines deeper into SourceMgr's error handling methods.
...
llvm-svn: 114847
2010-09-27 17:42:11 +00:00
David Greene
19324a5b81
Add an !eq() operator to TableGen. It operates on strings only.
...
Use !cast<string>() to compare other types of objects.
llvm-svn: 92754
2010-01-05 19:11:42 +00:00
Chandler Carruth
766362c707
Move DataTypes.h to include/llvm/System, update all users. This breaks the last
...
direct inclusion edge from System to Support.
llvm-svn: 85086
2009-10-26 01:35:46 +00:00
Chris Lattner
8646a745ca
prune #include, fix warning.
...
llvm-svn: 73847
2009-06-21 05:33:06 +00:00
Chris Lattner
c865ea76a6
move include searching logic from TGLexer to SourceMgr.
...
llvm-svn: 73845
2009-06-21 05:06:04 +00:00
Chris Lattner
5b9a2d79c0
Rename TGSourceMgr -> SourceMgr.
...
llvm-svn: 73844
2009-06-21 03:41:50 +00:00
Chris Lattner
4ff2620742
rename TGLoc -> SMLoc.
...
llvm-svn: 73843
2009-06-21 03:39:35 +00:00
David Greene
a51f014e59
Revert 73074 and 73099 because Windows doesn't have POSIX
...
regular expressions. We will add an OpenBSD implementation
and re-apply ASAP.
llvm-svn: 73138
2009-06-09 18:31:17 +00:00
David Greene
e3c4370a47
Add a !patsubst operator. Use on string types.
...
llvm-svn: 73099
2009-06-08 23:05:37 +00:00
David Greene
21ba6012b2
Add a !regmatch operator to do pattern matching in TableGen.
...
llvm-svn: 73074
2009-06-08 17:00:34 +00:00
David Greene
9a1e15d0d0
Implement !if, analogous to $(if) in GNU make.
...
llvm-svn: 71815
2009-05-14 23:26:46 +00:00
David Greene
70881bc6ae
Graduate LLVM to the big leagues by embedding a LISP processor into TableGen.
...
Ok, not really, but do support some common LISP functions:
* car
* cdr
* null
llvm-svn: 71805
2009-05-14 22:38:31 +00:00
David Greene
fab0ee79db
Implement a !foreach operator analogous to GNU make's $(foreach).
...
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
2009-05-14 22:23:47 +00:00
David Greene
26054a566e
Implement a !subst operation simmilar to $(subst) in GNU make to do
...
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
2009-05-14 21:54:42 +00:00
David Greene
e2871b8c65
Implement !cast.
...
llvm-svn: 71794
2009-05-14 21:22:49 +00:00
David Greene
5cc13bb60b
Operation Enhancements
...
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
2009-05-14 20:54:48 +00:00
David Greene
0698602922
Implement !nameconcat to concatenate strings and look up the resulting
...
name in the symbol table, returning an object.
llvm-svn: 69822
2009-04-22 20:18:10 +00:00
Chris Lattner
07709d8b69
make "locations" a class instead of a typedef.
...
llvm-svn: 66895
2009-03-13 16:01:53 +00:00
Chris Lattner
2f68f87510
split buffer management and diagnostic printing out of the tblgen
...
lexer into its own TGSourceMgr class.
llvm-svn: 66873
2009-03-13 07:05:43 +00:00
Argyrios Kyrtzidis
f1de51fd9f
Unbreak LLVM on the MSVC compiler:
...
-Bring in int64_t for TableGen/Record.h and TableGen/TGLexer.h
-Define strtoull
llvm-svn: 57970
2008-10-22 09:54:13 +00:00
Dan Gohman
268cfea6bc
Fun x86 encoding tricks: when adding an immediate value of 128,
...
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
2008-10-17 01:33:43 +00:00
Chris Lattner
c4006845a6
remove attributions from utils.
...
llvm-svn: 45419
2007-12-29 20:37:13 +00:00
Chris Lattner
59d787cb83
add missing #include
...
llvm-svn: 44282
2007-11-22 23:19:05 +00:00
Chris Lattner
c447b7a449
Rewrite the tblgen parser in a recursive descent style, eliminating the 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
2007-11-22 20:49:04 +00:00
Chris Lattner
4de076fe41
Record the start of the current token, for use in error reporting.
...
llvm-svn: 44227
2007-11-19 07:43:52 +00:00
Chris Lattner
b5d55431b7
Add carat diagnostics to tblgen lexer errors.
...
llvm-svn: 44226
2007-11-19 07:38:58 +00:00
Chris Lattner
07a4b4d5fe
reimplement the tblgen lexer with a simple hand-written lexer. This eliminates
...
one dependency on flex and gets rid of two ".cvs" files.
llvm-svn: 44210
2007-11-18 02:57:27 +00:00