Revert "Disable LeakSanitizer in TableGen binaries, see PR18325"
[oota-llvm.git] / utils / TableGen / TGValueTypes.cpp
index 81c0d4c544fc99f17f43b870db6e390886f63ff4..f4893f50a6ff86032509a8b998f4cf39e5ae33d7 100644 (file)
@@ -38,16 +38,17 @@ public:
   virtual ~Type();
 };
 
+// Provide out-of-line definition to prevent weak vtable.
 Type::~Type() {}
 
 }
 
+namespace {
 class ExtendedIntegerType : public Type {
   unsigned BitWidth;
 public:
   explicit ExtendedIntegerType(unsigned bits)
     : Type(TK_ExtendedIntegerType), BitWidth(bits) {}
-  virtual ~ExtendedIntegerType();
   static bool classof(const Type *T) {
     return T->getKind() == TK_ExtendedIntegerType;
   }
@@ -59,16 +60,12 @@ 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;
   }
@@ -82,9 +79,7 @@ public:
     return NumElements;
   }
 };
-
-ExtendedVectorType::~ExtendedVectorType() {}
-
+} // end anonymous namespace
 
 static std::map<unsigned, const Type *>
   ExtendedIntegerTypeMap;