Move the list of registers into CodeGenRegBank.
[oota-llvm.git] / utils / TableGen / Record.h
index 0853037fe3ed3e1e56f98b5c02045c49d0e8e9d4..522b719803c34061a35375b88467ce6001296417 100644 (file)
@@ -707,7 +707,7 @@ class CodeInit : public Init {
 public:
   explicit CodeInit(const std::string &V) : Value(V) {}
 
-  const std::string getValue() const { return Value; }
+  const std::string &getValue() const { return Value; }
 
   virtual Init *convertInitializerTo(RecTy *Ty) {
     return Ty->convertValue(this);
@@ -811,7 +811,7 @@ public:
 ///
 class UnOpInit : public OpInit {
 public:
-  enum UnaryOp { CAST, CAR, CDR, LNULL };
+  enum UnaryOp { CAST, HEAD, TAIL, EMPTY };
 private:
   UnaryOp Opc;
   Init *LHS;
@@ -931,6 +931,8 @@ public:
   // possible to fold.
   Init *Fold(Record *CurRec, MultiClass *CurMultiClass);
 
+  virtual bool isComplete() const { return false; }
+
   virtual Init *resolveReferences(Record &R, const RecordVal *RV);
 
   virtual std::string getAsString() const;
@@ -1234,8 +1236,8 @@ class Record {
 
 public:
 
-  // Constructs a record. See also RecordKeeper::createRecord.
-  explicit Record(const std::string &N, SMLoc loc, RecordKeeperrecords) :
+  // Constructs a record.
+  explicit Record(const std::string &N, SMLoc loc, RecordKeeper &records) :
     ID(LastID++), Name(N), Loc(loc), TrackedRecords(records) {}
   ~Record() {}
 
@@ -1322,7 +1324,7 @@ public:
   void resolveReferencesTo(const RecordVal *RV);
 
   RecordKeeper &getRecords() const {
-    return(TrackedRecords);
+    return TrackedRecords;
   }
 
   void dump() const;
@@ -1464,12 +1466,6 @@ public:
   std::vector<Record*>
   getAllDerivedDefinitions(const std::string &ClassName) const;
 
-  // allocates and returns a record. 
-  Record *createRecord(const std::string &N, SMLoc loc) {
-    return(new Record(N, loc, *this));
-  }
-
-
   void dump() const;
 };