return OS;
}
+
+/// BitRecTy - 'bit' - Represent a single bit
+///
struct BitRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(BitInit *BI) { return (Init*)BI; }
void print(std::ostream &OS) const { OS << "bit"; }
};
+
+/// BitsRecTy - 'bits<n>' - Represent a fixed number of bits
+///
class BitsRecTy : public RecTy {
unsigned Size;
public:
void print(std::ostream &OS) const { OS << "bits<" << Size << ">"; }
};
+
+/// IntRecTy - 'int' - Represent an integer value of no particular size
+///
struct IntRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(IntInit *II) { return (Init*)II; }
void print(std::ostream &OS) const { OS << "int"; }
};
+/// StringRecTy - 'string' - Represent an string value
+///
struct StringRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(StringInit *SI) { return (Init*)SI; }
void print(std::ostream &OS) const { OS << "string"; }
};
+/// ListRecTy - 'list<class>' - Represent a list defs, all of which must be
+/// derived from the specified class.
+///
class ListRecTy : public RecTy {
Record *Class;
public:
void print(std::ostream &OS) const;
};
+/// RecordRecTy - '<classname>' - Represent an instance of a class, such as:
+/// (R32 X = EAX).
+///
class RecordRecTy : public RecTy {
Record *Rec;
public:
void print(std::ostream &OS) const;
};
+
+
//===----------------------------------------------------------------------===//
// Initializer Classes
//===----------------------------------------------------------------------===//
I.print(OS); return OS;
}
+
+/// UnsetInit - ? - Represents an uninitialized value
+///
struct UnsetInit : public Init {
virtual Init *convertInitializerTo(RecTy *Ty) {
return Ty->convertValue(this);
virtual void print(std::ostream &OS) const { OS << "?"; }
};
+
+/// BitInit - true/false - Represent a concrete initializer for a bit.
+///
class BitInit : public Init {
bool Value;
public:
virtual void print(std::ostream &OS) const { OS << (Value ? "1" : "0"); }
};
+/// BitsInit - { a, b, c } - Represents an initializer for a BitsRecTy value.
+/// It contains a vector of bits, whose size is determined by the type.
+///
class BitsInit : public Init {
std::vector<Init*> Bits;
public:
bool printAsUnset(std::ostream &OS) const;
};
+
+/// IntInit - 7 - Represent an initalization by a literal integer value.
+///
class IntInit : public Init {
int Value;
public:
virtual void print(std::ostream &OS) const { OS << Value; }
};
+
+/// StringInit - "foo" - Represent an initialization by a string value.
+///
class StringInit : public Init {
std::string Value;
public:
virtual void print(std::ostream &OS) const { OS << "\"" << Value << "\""; }
};
+/// ListInit - [AL, AH, CL] - Represent a list of defs
+///
class ListInit : public Init {
std::vector<Record*> Records;
public:
virtual void print(std::ostream &OS) const;
};
+/// VarInit - 'Opcode' - Represent a reference to an entire variable object.
+///
class VarInit : public Init {
std::string VarName;
RecTy *Ty;
virtual void print(std::ostream &OS) const { OS << VarName; }
};
+
+/// VarBitInit - Opcode{0} - Represent access to one bit of a variable
+///
class VarBitInit : public Init {
VarInit *VI;
unsigned Bit;
virtual Init *resolveReferences(Record &R);
};
+
+/// DefInit - AL - Represent a reference to a 'def' in the description
+///
class DefInit : public Init {
Record *Def;
public:
return OS;
}
+
+/// BitRecTy - 'bit' - Represent a single bit
+///
struct BitRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(BitInit *BI) { return (Init*)BI; }
void print(std::ostream &OS) const { OS << "bit"; }
};
+
+/// BitsRecTy - 'bits<n>' - Represent a fixed number of bits
+///
class BitsRecTy : public RecTy {
unsigned Size;
public:
void print(std::ostream &OS) const { OS << "bits<" << Size << ">"; }
};
+
+/// IntRecTy - 'int' - Represent an integer value of no particular size
+///
struct IntRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(IntInit *II) { return (Init*)II; }
void print(std::ostream &OS) const { OS << "int"; }
};
+/// StringRecTy - 'string' - Represent an string value
+///
struct StringRecTy : public RecTy {
Init *convertValue(UnsetInit *UI) { return (Init*)UI; }
Init *convertValue(StringInit *SI) { return (Init*)SI; }
void print(std::ostream &OS) const { OS << "string"; }
};
+/// ListRecTy - 'list<class>' - Represent a list defs, all of which must be
+/// derived from the specified class.
+///
class ListRecTy : public RecTy {
Record *Class;
public:
void print(std::ostream &OS) const;
};
+/// RecordRecTy - '<classname>' - Represent an instance of a class, such as:
+/// (R32 X = EAX).
+///
class RecordRecTy : public RecTy {
Record *Rec;
public:
void print(std::ostream &OS) const;
};
+
+
//===----------------------------------------------------------------------===//
// Initializer Classes
//===----------------------------------------------------------------------===//
I.print(OS); return OS;
}
+
+/// UnsetInit - ? - Represents an uninitialized value
+///
struct UnsetInit : public Init {
virtual Init *convertInitializerTo(RecTy *Ty) {
return Ty->convertValue(this);
virtual void print(std::ostream &OS) const { OS << "?"; }
};
+
+/// BitInit - true/false - Represent a concrete initializer for a bit.
+///
class BitInit : public Init {
bool Value;
public:
virtual void print(std::ostream &OS) const { OS << (Value ? "1" : "0"); }
};
+/// BitsInit - { a, b, c } - Represents an initializer for a BitsRecTy value.
+/// It contains a vector of bits, whose size is determined by the type.
+///
class BitsInit : public Init {
std::vector<Init*> Bits;
public:
bool printAsUnset(std::ostream &OS) const;
};
+
+/// IntInit - 7 - Represent an initalization by a literal integer value.
+///
class IntInit : public Init {
int Value;
public:
virtual void print(std::ostream &OS) const { OS << Value; }
};
+
+/// StringInit - "foo" - Represent an initialization by a string value.
+///
class StringInit : public Init {
std::string Value;
public:
virtual void print(std::ostream &OS) const { OS << "\"" << Value << "\""; }
};
+/// ListInit - [AL, AH, CL] - Represent a list of defs
+///
class ListInit : public Init {
std::vector<Record*> Records;
public:
virtual void print(std::ostream &OS) const;
};
+/// VarInit - 'Opcode' - Represent a reference to an entire variable object.
+///
class VarInit : public Init {
std::string VarName;
RecTy *Ty;
virtual void print(std::ostream &OS) const { OS << VarName; }
};
+
+/// VarBitInit - Opcode{0} - Represent access to one bit of a variable
+///
class VarBitInit : public Init {
VarInit *VI;
unsigned Bit;
virtual Init *resolveReferences(Record &R);
};
+
+/// DefInit - AL - Represent a reference to a 'def' in the description
+///
class DefInit : public Init {
Record *Def;
public: