Commit Graph

24 Commits

Author SHA1 Message Date
Jim Grosbach d2aabd3bb2 TableGen: Location information for diagnostic.
def Pat<...>;

Results in 'record name is not a string!' diagnostic. Not the best,
but the lack of location information moves it from not very helpful
into completely useless. We're in the Record class when throwing the
error, so just add the location info directly.

llvm-svn: 160098
2012-07-12 00:53:31 +00:00
Jakob Stoklund Olesen aa0f752fc8 Fix infinite loop in nested multiclasses.
Patch by Michael Liao!

llvm-svn: 152232
2012-03-07 16:39:35 +00:00
Chandler Carruth 08a47fd708 Switch the TableGen record's string-based DenseMap key to use the new
hashing infrastructure. I wonder why we don't just use StringMap here,
and I may revisit the issue if I have time, but for now I'm just trying
to consolidate.

llvm-svn: 152023
2012-03-05 10:36:16 +00:00
Craig Topper a2886c21d9 Convert assert(0) to llvm_unreachable
llvm-svn: 149967
2012-02-07 05:05:23 +00:00
David Greene 6291f3a43c Implement String Cast from Integer
Allow casts from integer to string.

llvm-svn: 149273
2012-01-30 20:47:04 +00:00
David Blaikie 486df738c3 Removing unused default switch cases in switches over enums that already account for all enumeration values explicitly.
(This time I believe I've checked all the -Wreturn-type warnings from GCC & added the couple of llvm_unreachables necessary to silence them. If I've missed any, I'll happily fix them as soon as I know about them)

llvm-svn: 148262
2012-01-16 23:24:27 +00:00
Jakob Stoklund Olesen dd8fbf572e Delete CodeInit and CodeRecTy from TableGen.
The code type was always identical to a string anyway. Now it is simply
a synonym. The code literal syntax [{...}] is still valid.

llvm-svn: 148092
2012-01-13 03:38:34 +00:00
Jakob Stoklund Olesen 9d1c5eeb32 Use uniqued StringInit pointers for lookups.
This avoids a gazillion StringMap and dynamic_cast calls, making
TableGen run 3x faster.

llvm-svn: 148091
2012-01-13 03:16:35 +00:00
David Blaikie a379b18173 Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch
llvm-svn: 146960
2011-12-20 02:50:00 +00:00
Jim Grosbach 12952fef71 ARM vldm and vstm VFP instructions can take a data type suffix.
It's ignored by the assembler when present, but is legal syntax. Other
instructions have something similar, but for some mnemonics it's
only sometimes not significant, so this quick check in the parser will
need refactored into something more robust soon-ish. This gets some
basics working in the meantime.

Partial for rdar://10435264

llvm-svn: 144422
2011-11-11 23:08:10 +00:00
David Greene d699161a99 Add NAME Member
Add a Value named "NAME" to each Record.  This will be set to the def or defm
name when instantiating multiclasses.  This will replace the #NAME# processing
hack once paste functionality is in place.

llvm-svn: 142518
2011-10-19 13:04:13 +00:00
David Greene 9effff28c8 Resolve Record Names
When resolving Record values, be sure to update the Record name as it
may contain references to the value.

llvm-svn: 142511
2011-10-19 13:03:30 +00:00
David Greene f651a2a5c0 Allow Names Changes on Unregistered Records
Add Record names to be changed even on Records that aren't yet
registered.  We need to be able to do this for paste functionality
because we do not want to register def names before they are unique
and that can only happen once all paste operations are done.  This
change lets us update Record names formed by paste operations and
register the result later.

llvm-svn: 142510
2011-10-19 13:03:25 +00:00
David Greene 077d84e6f3 Fix Name Access
Ask for the Record name as a string explicitly to avoid a possible assert.

llvm-svn: 142506
2011-10-19 13:03:02 +00:00
David Greene 98be78aeea Fix Name Access
Ask for the Record name as a string explicitly to avoid a possible
assert.

llvm-svn: 142505
2011-10-19 13:02:57 +00:00
David Greene 658a4b71b6 Fix Name Access
Ask for the record name as a string explicitly to avoid a potential
assert.

llvm-svn: 142504
2011-10-19 13:02:52 +00:00
David Greene b77fc0d906 Add Record Init
Add an init function to be shared among Record constructors.

llvm-svn: 142501
2011-10-19 13:02:45 +00:00
David Greene db10e69138 Make Template Arg Names Inits
Allow template arg names to be Inits.  This is further work to
implement paste as it allows template names to participate in paste
operations.

llvm-svn: 142500
2011-10-19 13:02:42 +00:00
David Greene e714512cb6 Add Utility to Scope Names
Add a couple of utility functions to take a variable name and qualify
it with the namespace of the enclosing class and/or multiclass.  This
is inpreparation for making template arg names first-class Inits.

llvm-svn: 142498
2011-10-19 13:02:36 +00:00
David Greene 914adf0ecb Make VarInit Name an Init
Make the VarInit name an Init itself.  We need this to implement paste
functionality so we can reference variables whose names are not yet
completely resolved.

llvm-svn: 142497
2011-10-19 13:02:33 +00:00
David Greene 28438acd46 Add Value Accessors
Add accessors to get Record values by Init name.  This lets us look up
Record values whose names are not yet fully resolved.  More work
toward paste.

llvm-svn: 142496
2011-10-19 13:02:29 +00:00
David Greene 7475ad05fa Fix List-of-List Processing
Fix VarListElementInit::resolveListElementReference to return a
partially resolved VarListElementInint in the case where full
resolution is not possible.  This allows TableGen to make forward
progress resolving certain complex list expressions.

llvm-svn: 141315
2011-10-06 21:20:46 +00:00
David Greene a8b8ab6b20 Allow Operator Arguments
When resolving an operator list element reference, resolve all
operator operands and try to fold the operator first.  This allows the
operator to collapse to a list which may then be indexed.

Before, it was not possible to do this:
class D<int a, int b> { ... }
class C<list<int> A> : D<A[0], A[1]>;
class B<list<int> b> : C<!foreach(...,b)>;

Now it is.

llvm-svn: 141101
2011-10-04 18:55:36 +00:00
Peter Collingbourne 84c287e33c Move TableGen's parser and entry point into a library
This is the first step towards splitting LLVM and Clang's tblgen executables.

llvm-svn: 140951
2011-10-01 16:41:13 +00:00