summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2012-03-27 21:48:58 +0200
committerChristoph Bumiller <[email protected]>2012-04-14 21:54:02 +0200
commit4a44f94caf8887f6dfc66c4193e95c6430c9de57 (patch)
tree629468db4d3d4990a4e6b83e1567f9e4630c2f07 /src/gallium
parenta5397851870d3a9969b2b864c849ba209ef9b0f7 (diff)
nv50/ir: Clean up before calculating instruction ordering for a new function.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp2
-rw-r--r--src/gallium/drivers/nv50/codegen/nv50_ir_util.h14
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp b/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
index 6515ba7e0c9..7b211a2e0d1 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_bb.cpp
@@ -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()));
diff --git a/src/gallium/drivers/nv50/codegen/nv50_ir_util.h b/src/gallium/drivers/nv50/codegen/nv50_ir_util.h
index 262cf9cd496..830320721d1 100644
--- a/src/gallium/drivers/nv50/codegen/nv50_ir_util.h
+++ b/src/gallium/drivers/nv50/codegen/nv50_ir_util.h
@@ -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;