[llvm] r238727 - [TableGen] Move a couple virtual methods out of line so vtable anchors can be removed. NFC
Craig Topper
craig.topper at gmail.com
Sun May 31 23:44:19 PDT 2015
Author: ctopper
Date: Mon Jun 1 01:44:18 2015
New Revision: 238727
URL: http://llvm.org/viewvc/llvm-project?rev=238727&view=rev
Log:
[TableGen] Move a couple virtual methods out of line so vtable anchors can be removed. NFC
Modified:
llvm/trunk/include/llvm/TableGen/Record.h
llvm/trunk/lib/TableGen/Record.cpp
Modified: llvm/trunk/include/llvm/TableGen/Record.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=238727&r1=238726&r2=238727&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h (original)
+++ llvm/trunk/include/llvm/TableGen/Record.h Mon Jun 1 01:44:18 2015
@@ -139,7 +139,6 @@ class StringRecTy : public RecTy {
static StringRecTy Shared;
StringRecTy() : RecTy(StringRecTyKind) {}
- virtual void anchor();
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == StringRecTyKind;
@@ -147,7 +146,7 @@ public:
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
@@ -177,7 +176,6 @@ class DagRecTy : public RecTy {
static DagRecTy Shared;
DagRecTy() : RecTy(DagRecTyKind) {}
- virtual void anchor();
public:
static bool classof(const RecTy *RT) {
return RT->getRecTyKind() == DagRecTyKind;
@@ -185,7 +183,7 @@ public:
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:
Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=238727&r1=238726&r2=238727&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Mon Jun 1 01:44:18 2015
@@ -88,9 +88,6 @@ DagRecTy DagRecTy::Shared;
void RecTy::dump() const { print(errs()); }
-void StringRecTy::anchor() { }
-void DagRecTy::anchor() { }
-
ListRecTy *RecTy::getListTy() {
if (!ListTy)
ListTy.reset(new ListRecTy(this));
@@ -136,6 +133,9 @@ bool IntRecTy::typeIsConvertibleTo(const
return kind==BitRecTyKind || kind==BitsRecTyKind || kind==IntRecTyKind;
}
+std::string StringRecTy::getAsString() const {
+ return "string";
+}
std::string ListRecTy::getAsString() const {
return "list<" + Ty->getAsString() + ">";
@@ -147,6 +147,10 @@ bool ListRecTy::typeIsConvertibleTo(cons
return false;
}
+std::string DagRecTy::getAsString() const {
+ return "dag";
+}
+
RecordRecTy *RecordRecTy::get(Record *R) {
return dyn_cast<RecordRecTy>(R->getDefInit()->getType());
}
More information about the llvm-commits
mailing list