diff options
Diffstat (limited to 'utils/TableGen/TGValueTypes.cpp')
-rw-r--r-- | utils/TableGen/TGValueTypes.cpp | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/utils/TableGen/TGValueTypes.cpp b/utils/TableGen/TGValueTypes.cpp index 81c0d4c544..3ac71a4914 100644 --- a/utils/TableGen/TGValueTypes.cpp +++ b/utils/TableGen/TGValueTypes.cpp @@ -35,11 +35,9 @@ public: } Type(TypeKind K) : Kind(K) {} virtual unsigned getSizeInBits() const = 0; - virtual ~Type(); + virtual ~Type() {} }; -Type::~Type() {} - } class ExtendedIntegerType : public Type { @@ -47,11 +45,10 @@ class ExtendedIntegerType : public Type { public: explicit ExtendedIntegerType(unsigned bits) : Type(TK_ExtendedIntegerType), BitWidth(bits) {} - virtual ~ExtendedIntegerType(); static bool classof(const Type *T) { return T->getKind() == TK_ExtendedIntegerType; } - virtual unsigned getSizeInBits() const { + unsigned getSizeInBits() const { return getBitWidth(); } unsigned getBitWidth() const { @@ -59,20 +56,16 @@ public: } }; -ExtendedIntegerType::~ExtendedIntegerType() {} - - class ExtendedVectorType : public Type { EVT ElementType; unsigned NumElements; public: ExtendedVectorType(EVT elty, unsigned num) : Type(TK_ExtendedVectorType), ElementType(elty), NumElements(num) {} - virtual ~ExtendedVectorType(); static bool classof(const Type *T) { return T->getKind() == TK_ExtendedVectorType; } - virtual unsigned getSizeInBits() const { + unsigned getSizeInBits() const { return getNumElements() * getElementType().getSizeInBits(); } EVT getElementType() const { @@ -83,9 +76,6 @@ public: } }; -ExtendedVectorType::~ExtendedVectorType() {} - - static std::map<unsigned, const Type *> ExtendedIntegerTypeMap; static std::map<std::pair<uintptr_t, uintptr_t>, const Type *> |