diff options
author | David Greene <greened@obbligato.org> | 2009-04-22 20:18:10 +0000 |
---|---|---|
committer | David Greene <greened@obbligato.org> | 2009-04-22 20:18:10 +0000 |
commit | c7cafcd815519b06318629b424abe746437e1389 (patch) | |
tree | cb53439bdde7bbb4e94db441f65f2b420ca48052 /utils/TableGen/Record.h | |
parent | d7b2f7ffcecee2809cf75d71374319dc0e73a71b (diff) | |
download | external_llvm-c7cafcd815519b06318629b424abe746437e1389.zip external_llvm-c7cafcd815519b06318629b424abe746437e1389.tar.gz external_llvm-c7cafcd815519b06318629b424abe746437e1389.tar.bz2 |
Implement !nameconcat to concatenate strings and look up the resulting
name in the symbol table, returning an object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69822 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/Record.h')
-rw-r--r-- | utils/TableGen/Record.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/utils/TableGen/Record.h b/utils/TableGen/Record.h index 32172ef..b408452 100644 --- a/utils/TableGen/Record.h +++ b/utils/TableGen/Record.h @@ -53,6 +53,7 @@ class VarListElementInit; // Other classes. class Record; class RecordVal; +class MultiClass; //===----------------------------------------------------------------------===// // Type Classes @@ -659,7 +660,7 @@ public: /// class BinOpInit : public Init { public: - enum BinaryOp { SHL, SRA, SRL, STRCONCAT, CONCAT }; + enum BinaryOp { SHL, SRA, SRL, STRCONCAT, CONCAT, NAMECONCAT }; private: BinaryOp Opc; Init *LHS, *RHS; @@ -673,7 +674,7 @@ public: // Fold - If possible, fold this to a simpler init. Return this if not // possible to fold. - Init *Fold(); + Init *Fold(Record *CurRec, MultiClass *CurMultiClass); virtual Init *convertInitializerTo(RecTy *Ty) { return Ty->convertValue(this); @@ -1124,6 +1125,14 @@ public: std::ostream &operator<<(std::ostream &OS, const Record &R); +struct MultiClass { + Record Rec; // Placeholder for template args and Name. + typedef std::vector<Record*> RecordVector; + RecordVector DefPrototypes; + + MultiClass(const std::string &Name, TGLoc Loc) : Rec(Name, Loc) {} +}; + class RecordKeeper { std::map<std::string, Record*> Classes, Defs; public: |