return OS;
}
-
/// BitRecTy - 'bit' - Represent a single bit
///
class BitRecTy : public RecTy {
static BitRecTy Shared;
BitRecTy() : RecTy(BitRecTyKind) {}
+
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == BitRecTyKind;
bool baseClassOf(const RecTy*) const override;
};
-
/// BitsRecTy - 'bits<n>' - Represent a fixed number of bits
///
class BitsRecTy : public RecTy {
unsigned Size;
explicit BitsRecTy(unsigned Sz) : RecTy(BitsRecTyKind), Size(Sz) {}
+
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == BitsRecTyKind;
bool baseClassOf(const RecTy*) const override;
};
-
/// IntRecTy - 'int' - Represent an integer value of no particular size
///
class IntRecTy : public RecTy {
static IntRecTy Shared;
IntRecTy() : RecTy(IntRecTyKind) {}
+
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == IntRecTyKind;
class StringRecTy : public RecTy {
static StringRecTy Shared;
StringRecTy() : RecTy(StringRecTyKind) {}
+
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == StringRecTyKind;
RecTy *Ty;
explicit ListRecTy(RecTy *T) : RecTy(ListRecTyKind), Ty(T) {}
friend ListRecTy *RecTy::getListTy();
+
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == ListRecTyKind;
class DagRecTy : public RecTy {
static DagRecTy Shared;
DagRecTy() : RecTy(DagRecTyKind) {}
+
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == DagRecTyKind;
}
};
-
/// RecordRecTy - '[classname]' - Represent an instance of a class, such as:
/// (R32 X = EAX).
///
Record *Rec;
explicit RecordRecTy(Record *R) : RecTy(RecordRecTyKind), Rec(R) {}
friend class Record;
+
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == RecordRecTyKind;
unsigned Elt) const = 0;
};
-
/// UnsetInit - ? - Represents an uninitialized value
///
class UnsetInit : public Init {
std::string getAsString() const override { return "?"; }
};
-
/// BitInit - true/false - Represent a concrete initializer for a bit.
///
class BitInit : public Init {
}
};
-
/// IntInit - 7 - Represent an initialization by a literal integer value.
///
class IntInit : public TypedInit {
}
};
-
/// StringInit - "foo" - Represent an initialization by a string value.
///
class StringInit : public TypedInit {
///
class ListInit : public TypedInit, public FoldingSetNode {
std::vector<Init*> Values;
+
public:
typedef std::vector<Init*>::const_iterator const_iterator;
}
};
-
/// OpInit - Base class for operators
///
class OpInit : public TypedInit {
Init *getBit(unsigned Bit) const override;
};
-
/// UnOpInit - !op (X) - Transform an init.
///
class UnOpInit : public OpInit {
public:
enum UnaryOp { CAST, HEAD, TAIL, EMPTY };
+
private:
UnaryOp Opc;
Init *LHS;
class TernOpInit : public OpInit {
public:
enum TernaryOp { SUBST, FOREACH, IF };
+
private:
TernaryOp Opc;
Init *LHS, *MHS, *RHS;
std::string getAsString() const override;
};
-
/// VarInit - 'Opcode' - Represent a reference to an entire variable object.
///
class VarInit : public TypedInit {
std::string getAsString() const override { return getName(); }
};
-
/// VarBitInit - Opcode{0} - Represent access to one bit of a variable or field.
///
class VarBitInit : public Init {
}
};
-
/// FieldInit - X.Y - Represent a reference to a subfield of a variable
///
class FieldInit : public TypedInit {
RecTy *Ty;
unsigned Prefix;
Init *Value;
+
public:
RecordVal(Init *N, RecTy *T, unsigned P);
RecordVal(const std::string &N, RecTy *T, unsigned P);
void checkName();
public:
-
// Constructs a record.
explicit Record(const std::string &N, ArrayRef<SMLoc> locs,
RecordKeeper &records, bool Anonymous = false) :
~Record() {}
-
static unsigned getNewUID() { return LastID++; }
-
unsigned getID() const { return ID; }
const std::string &getName() const;
namespace llvm {
class raw_ostream;
-
+
/// StringMatcher - Given a list of strings and code to execute when they match,
/// output a simple switch tree to classify the input string.
-///
+///
/// If a match is found, the code in Vals[i].second is executed; control must
/// not exit this code fragment. If nothing matches, execution falls through.
///
class StringMatcher {
public:
typedef std::pair<std::string, std::string> StringPair;
+
private:
StringRef StrVariableName;
const std::vector<StringPair> &Matches;
raw_ostream &OS;
-
+
public:
StringMatcher(StringRef strVariableName,
const std::vector<StringPair> &matches, raw_ostream &os)
: StrVariableName(strVariableName), Matches(matches), OS(os) {}
-
+
void Emit(unsigned Indent = 0) const;
-
-
+
private:
bool EmitStringMatcherForChar(const std::vector<const StringPair*> &Matches,
unsigned CharNo, unsigned IndentCount) const;