aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-11-18 09:31:53 +0000
committerAlexey Samsonov <samsonov@google.com>2013-11-18 09:31:53 +0000
commitb21ab43cfc3fa0dacf5c95f04e58b6d804b59a16 (patch)
tree12f522231a5b3a875b1ac733a5bf1b1025088c7c /tools
parent69b2447b6a3fcc303e03cba8c7c50d745b0284d2 (diff)
downloadexternal_llvm-b21ab43cfc3fa0dacf5c95f04e58b6d804b59a16.zip
external_llvm-b21ab43cfc3fa0dacf5c95f04e58b6d804b59a16.tar.gz
external_llvm-b21ab43cfc3fa0dacf5c95f04e58b6d804b59a16.tar.bz2
Revert r194865 and r194874.
This change is incorrect. If you delete virtual destructor of both a base class and a subclass, then the following code: Base *foo = new Child(); delete foo; will not cause the destructor for members of Child class. As a result, I observe plently of memory leaks. Notable examples I investigated are: ObjectBuffer and ObjectBufferStream, AttributeImpl and StringSAttributeImpl. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194997 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/llvm-stress/llvm-stress.cpp40
1 files changed, 1 insertions, 39 deletions
diff --git a/tools/llvm-stress/llvm-stress.cpp b/tools/llvm-stress/llvm-stress.cpp
index d262a69..15f7abf 100644
--- a/tools/llvm-stress/llvm-stress.cpp
+++ b/tools/llvm-stress/llvm-stress.cpp
@@ -128,7 +128,7 @@ public:
BB(Block),PT(PT),Ran(R),Context(BB->getContext()) {}
/// virtual D'tor to silence warnings.
- virtual ~Modifier();
+ virtual ~Modifier() {}
/// Add a new instruction.
virtual void Act() = 0;
@@ -285,11 +285,8 @@ protected:
LLVMContext &Context;
};
-Modifier::~Modifier() {}
-
struct LoadModifier: public Modifier {
LoadModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
- virtual ~LoadModifier();
virtual void Act() {
// Try to use predefined pointers. If non exist, use undef pointer value;
Value *Ptr = getRandomPointerValue();
@@ -298,11 +295,8 @@ struct LoadModifier: public Modifier {
}
};
-LoadModifier::~LoadModifier() {}
-
struct StoreModifier: public Modifier {
StoreModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
- virtual ~StoreModifier();
virtual void Act() {
// Try to use predefined pointers. If non exist, use undef pointer value;
Value *Ptr = getRandomPointerValue();
@@ -319,11 +313,8 @@ struct StoreModifier: public Modifier {
}
};
-StoreModifier::~StoreModifier() {}
-
struct BinModifier: public Modifier {
BinModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
- virtual ~BinModifier();
virtual void Act() {
Value *Val0 = getRandomVal();
@@ -365,13 +356,9 @@ struct BinModifier: public Modifier {
}
};
-BinModifier::~BinModifier() {}
-
/// Generate constant values.
struct ConstModifier: public Modifier {
ConstModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
- virtual ~ConstModifier();
-
virtual void Act() {
Type *Ty = pickType();
@@ -416,11 +403,8 @@ struct ConstModifier: public Modifier {
}
};
-ConstModifier::~ConstModifier() {}
-
struct AllocaModifier: public Modifier {
AllocaModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R){}
- virtual ~AllocaModifier();
virtual void Act() {
Type *Tp = pickType();
@@ -428,12 +412,9 @@ struct AllocaModifier: public Modifier {
}
};
-AllocaModifier::~AllocaModifier() {}
-
struct ExtractElementModifier: public Modifier {
ExtractElementModifier(BasicBlock *BB, PieceTable *PT, Random *R):
Modifier(BB, PT, R) {}
- virtual ~ExtractElementModifier();
virtual void Act() {
Value *Val0 = getRandomVectorValue();
@@ -445,12 +426,8 @@ struct ExtractElementModifier: public Modifier {
}
};
-ExtractElementModifier::~ExtractElementModifier() {}
-
struct ShuffModifier: public Modifier {
ShuffModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
- virtual ~ShuffModifier();
-
virtual void Act() {
Value *Val0 = getRandomVectorValue();
@@ -476,12 +453,9 @@ struct ShuffModifier: public Modifier {
}
};
-ShuffModifier::~ShuffModifier() {}
-
struct InsertElementModifier: public Modifier {
InsertElementModifier(BasicBlock *BB, PieceTable *PT, Random *R):
Modifier(BB, PT, R) {}
- virtual ~InsertElementModifier();
virtual void Act() {
Value *Val0 = getRandomVectorValue();
@@ -496,12 +470,8 @@ struct InsertElementModifier: public Modifier {
};
-InsertElementModifier::~InsertElementModifier() {}
-
struct CastModifier: public Modifier {
CastModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
- virtual ~CastModifier();
-
virtual void Act() {
Value *V = getRandomVal();
@@ -585,12 +555,9 @@ struct CastModifier: public Modifier {
};
-CastModifier::~CastModifier() {}
-
struct SelectModifier: public Modifier {
SelectModifier(BasicBlock *BB, PieceTable *PT, Random *R):
Modifier(BB, PT, R) {}
- virtual ~SelectModifier();
virtual void Act() {
// Try a bunch of different select configuration until a valid one is found.
@@ -612,12 +579,9 @@ struct SelectModifier: public Modifier {
}
};
-SelectModifier::~SelectModifier() {}
struct CmpModifier: public Modifier {
CmpModifier(BasicBlock *BB, PieceTable *PT, Random *R):Modifier(BB, PT, R) {}
- virtual ~CmpModifier();
-
virtual void Act() {
Value *Val0 = getRandomVal();
@@ -643,8 +607,6 @@ struct CmpModifier: public Modifier {
}
};
-CmpModifier::~CmpModifier() {}
-
void FillFunction(Function *F, Random &R) {
// Create a legal entry block.
BasicBlock *BB = BasicBlock::Create(F->getContext(), "BB", F);