Program::~Program()
{
- if (main)
- delete main;
+ for (ArrayList::Iterator it = allFuncs.iterator(); !it.end(); it.next())
+ delete reinterpret_cast<Function *>(it.get());
+
+ for (ArrayList::Iterator it = allRValues.iterator(); !it.end(); it.next())
+ releaseValue(reinterpret_cast<Value *>(it.get()));
}
void Program::releaseInstruction(Instruction *insn)
void Program::releaseValue(Value *value)
{
+ value->~Value();
+
if (value->asLValue())
mem_LValue.release(value);
else
{
public:
Value();
+ virtual ~Value() { }
virtual Value *clone(Function *) const { return NULL; }
public:
LValue(Function *, DataFile file);
LValue(Function *, LValue *);
+ ~LValue() { }
virtual Value *clone(Function *) const;
{
public:
Symbol(Program *, DataFile file = FILE_MEMORY_CONST, ubyte fileIdx = 0);
+ ~Symbol() { }
virtual Value *clone(Function *) const;
ImmediateValue(Program *, uint32_t);
ImmediateValue(Program *, float);
ImmediateValue(Program *, double);
-
// NOTE: not added to program with
ImmediateValue(const ImmediateValue *, DataType ty);
+ ~ImmediateValue() { };
virtual bool equals(const Value *that, bool strict) const;
if (bbArray)
delete[] bbArray;
+ for (ArrayList::Iterator it = allInsns.iterator(); !it.end(); it.next())
+ delete_Instruction(prog, reinterpret_cast<Instruction *>(it.get()));
+
+ for (ArrayList::Iterator it = allLValues.iterator(); !it.end(); it.next())
+ delete_Value(prog, reinterpret_cast<LValue *>(it.get()));
+
for (ArrayList::Iterator BBs = allBBlocks.iterator(); !BBs.end(); BBs.next())
delete reinterpret_cast<BasicBlock *>(BBs.get());
}