nv50/ir: Clean up before calculating instruction ordering for a new function.

This commit is contained in:
Francisco Jerez 2012-03-27 21:48:58 +02:00 committed by Christoph Bumiller
parent a539785187
commit 4a44f94caf
2 changed files with 16 additions and 0 deletions

View File

@ -405,6 +405,8 @@ Function::setExit(BasicBlock *bb)
unsigned int
Function::orderInstructions(ArrayList &result)
{
result.clear();
for (IteratorRef it = cfg.iteratorCFG(); !it->end(); it->next()) {
BasicBlock *bb =
BasicBlock::get(reinterpret_cast<Graph::Node *>(it->get()));

View File

@ -337,6 +337,13 @@ public:
data = (Item *)REALLOC(data, oldSize, size * sizeof(Item));
}
void clear()
{
FREE(data);
data = NULL;
size = 0;
}
private:
Item *data;
unsigned int size;
@ -392,6 +399,13 @@ public:
Iterator iterator() const { return Iterator(this); }
void clear()
{
data.clear();
ids.clear(true);
size = 0;
}
private:
DynArray data;
Stack ids;