diff options
author | David Greene <greened@obbligato.org> | 2011-10-05 22:42:17 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2011-10-05 22:42:17 +0000 |
commit | bda579b8bab763f0b741c5775350cda09a394115 (patch) | |
tree | 748114777522eed0d2901f3b354d371b30d87362 /include/llvm/TableGen | |
parent | e499a2df4492dab21a50d74f3f687b989f910a2f (diff) | |
download | llvm-bda579b8bab763f0b741c5775350cda09a394115.tar.gz llvm-bda579b8bab763f0b741c5775350cda09a394115.tar.bz2 llvm-bda579b8bab763f0b741c5775350cda09a394115.tar.xz |
Add Multidef Data Structures
Add a set of data structures and members analogous to those used for
multiclass defs. These will represent a new kind of multiclass def: a
multidef. The idea behind the multidef is to process a list of items
and create a def record for each one inside the enclosing multiclass.
This allows the user to dynamically create a set of defs based on the
contents of a list.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141230 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/TableGen')
-rw-r--r-- | include/llvm/TableGen/Record.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/llvm/TableGen/Record.h b/include/llvm/TableGen/Record.h index afce760998..0fc50c5a3b 100644 --- a/include/llvm/TableGen/Record.h +++ b/include/llvm/TableGen/Record.h @@ -1568,6 +1568,23 @@ struct MultiClass { typedef std::vector<Record*> RecordVector; RecordVector DefPrototypes; + struct MultiDef { + Record *Rec; // The base record for all defs generated. + // This serves as the multiclass def prototype. + TypedInit *List; // A list of values to process. + // Each one generates a new def. + IntInit *Start; // This specified the list index from which to start + // processing. + std::string ItemName; // The name of a temporary iterator value to + // track the current list item being processed. + + MultiDef(Record *R, TypedInit *L, IntInit *S, const std::string &I) + : Rec(R), List(L), Start(S), ItemName(I) {}; + }; + + typedef std::vector<MultiDef> MultiDefVector; + MultiDefVector MultiDefPrototypes; + void dump() const; MultiClass(const std::string &Name, SMLoc Loc, RecordKeeper &Records) : |