llvm.org GIT mirror llvm / dd2a26f
[TableGen] Move a couple virtual methods out of line so vtable anchors can be removed. NFC git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238727 91177308-0d34-0410-b5e6-96231b3b80d8 Craig Topper 5 years ago
2 changed file(s) with 9 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
138138 static StringRecTy Shared;
139139 StringRecTy() : RecTy(StringRecTyKind) {}
140140
141 virtual void anchor();
142141 public:
143142 static bool classof(const RecTy *RT) {
144143 return RT->getRecTyKind() == StringRecTyKind;
146145
147146 static StringRecTy *get() { return &Shared; }
148147
149 std::string getAsString() const override { return "string"; }
148 std::string getAsString() const override;
150149 };
151150
152151 /// ListRecTy - 'list' - Represent a list of values, all of which must be of
176175 static DagRecTy Shared;
177176 DagRecTy() : RecTy(DagRecTyKind) {}
178177
179 virtual void anchor();
180178 public:
181179 static bool classof(const RecTy *RT) {
182180 return RT->getRecTyKind() == DagRecTyKind;
184182
185183 static DagRecTy *get() { return &Shared; }
186184
187 std::string getAsString() const override { return "dag"; }
185 std::string getAsString() const override;
188186 };
189187
190188 /// RecordRecTy - '[classname]' - Represent an instance of a class, such as:
8787
8888 void RecTy::dump() const { print(errs()); }
8989
90 void StringRecTy::anchor() { }
91 void DagRecTy::anchor() { }
92
9390 ListRecTy *RecTy::getListTy() {
9491 if (!ListTy)
9592 ListTy.reset(new ListRecTy(this));
135132 return kind==BitRecTyKind || kind==BitsRecTyKind || kind==IntRecTyKind;
136133 }
137134
135 std::string StringRecTy::getAsString() const {
136 return "string";
137 }
138138
139139 std::string ListRecTy::getAsString() const {
140140 return "list<" + Ty->getAsString() + ">";
144144 if (const auto *ListTy = dyn_cast(RHS))
145145 return Ty->typeIsConvertibleTo(ListTy->getElementType());
146146 return false;
147 }
148
149 std::string DagRecTy::getAsString() const {
150 return "dag";
147151 }
148152
149153 RecordRecTy *RecordRecTy::get(Record *R) {