[AVX] Make Inits Foldable
[oota-llvm.git] / utils / TableGen / TGParser.h
index 94a1c2b2b258265fd6e99d52a6c0d290ef66f8e9..562c36173f1c38c35cfdac1fa55d6e433f039b56 100644 (file)
@@ -33,10 +33,10 @@ namespace llvm {
   struct LetRecord {
     std::string Name;
     std::vector<unsigned> Bits;
-    Init *Value;
+    const Init *Value;
     SMLoc Loc;
-    LetRecord(const std::string &N, const std::vector<unsigned> &B, Init *V,
-              SMLoc L)
+    LetRecord(const std::string &N, const std::vector<unsigned> &B,
+              const Init *V, SMLoc L)
       : Name(N), Bits(B), Value(V), Loc(L) {
     }
   };
@@ -73,7 +73,7 @@ public:
 private:  // Semantic analysis methods.
   bool AddValue(Record *TheRec, SMLoc Loc, const RecordVal &RV);
   bool SetValue(Record *TheRec, SMLoc Loc, const std::string &ValName, 
-                const std::vector<unsigned> &BitList, Init *V);
+                const std::vector<unsigned> &BitList, const Init *V);
   bool AddSubClass(Record *Rec, SubClassReference &SubClass);
   bool AddSubMultiClass(MultiClass *CurMC,
                         SubMultiClassReference &SubMultiClass);
@@ -98,18 +98,20 @@ private:  // Parser methods.
   SubClassReference ParseSubClassReference(Record *CurRec, bool isDefm);
   SubMultiClassReference ParseSubMultiClassReference(MultiClass *CurMC);
 
-  Init *ParseIDValue(Record *CurRec);
-  Init *ParseIDValue(Record *CurRec, const std::string &Name, SMLoc NameLoc);
-  Init *ParseSimpleValue(Record *CurRec, RecTy *ItemType = 0);
-  Init *ParseValue(Record *CurRec, RecTy *ItemType = 0);
-  std::vector<Init*> ParseValueList(Record *CurRec, Record *ArgsRec = 0, RecTy *EltTy = 0);
-  std::vector<std::pair<llvm::Init*, std::string> > ParseDagArgList(Record *);
+  const Init *ParseIDValue(Record *CurRec);
+  const Init *ParseIDValue(Record *CurRec, const std::string &Name,
+                           SMLoc NameLoc);
+  const Init *ParseSimpleValue(Record *CurRec, RecTy *ItemType = 0);
+  const Init *ParseValue(Record *CurRec, RecTy *ItemType = 0);
+  std::vector<const Init*> ParseValueList(Record *CurRec, Record *ArgsRec = 0,
+                                          RecTy *EltTy = 0);
+  std::vector<std::pair<const Init*, std::string> > ParseDagArgList(Record *);
   bool ParseOptionalRangeList(std::vector<unsigned> &Ranges);
   bool ParseOptionalBitList(std::vector<unsigned> &Ranges);
   std::vector<unsigned> ParseRangeList();
   bool ParseRangePiece(std::vector<unsigned> &Ranges);
   RecTy *ParseType();
-  Init *ParseOperation(Record *CurRec);
+  const Init *ParseOperation(Record *CurRec);
   RecTy *ParseOperatorType();
   std::string ParseObjectName();
   Record *ParseClassID();