summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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;