static StringRecTy Shared;
StringRecTy() : RecTy(StringRecTyKind) {}
- virtual void anchor();
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == StringRecTyKind;
static StringRecTy *get() { return &Shared; }
- std::string getAsString() const override { return "string"; }
+ std::string getAsString() const override;
};
/// ListRecTy - 'list<Ty>' - Represent a list of values, all of which must be of
static DagRecTy Shared;
DagRecTy() : RecTy(DagRecTyKind) {}
- virtual void anchor();
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == DagRecTyKind;
static DagRecTy *get() { return &Shared; }
- std::string getAsString() const override { return "dag"; }
+ std::string getAsString() const override;
};
/// RecordRecTy - '[classname]' - Represent an instance of a class, such as:
void RecTy::dump() const { print(errs()); }
-void StringRecTy::anchor() { }
-void DagRecTy::anchor() { }
-
ListRecTy *RecTy::getListTy() {
if (!ListTy)
ListTy.reset(new ListRecTy(this));
return kind==BitRecTyKind || kind==BitsRecTyKind || kind==IntRecTyKind;
}
+std::string StringRecTy::getAsString() const {
+ return "string";
+}
std::string ListRecTy::getAsString() const {
return "list<" + Ty->getAsString() + ">";
return false;
}
+std::string DagRecTy::getAsString() const {
+ return "dag";
+}
+
RecordRecTy *RecordRecTy::get(Record *R) {
return dyn_cast<RecordRecTy>(R->getDefInit()->getType());
}