From 051645c92924bf915d82bf219f2ed67309b5577a Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Sun, 31 Dec 2017 07:12:27 +0000 Subject: Merge Mesa 17.2.8 --- .../src/gallium/drivers/r600/sb/sb_valtable.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) (limited to 'lib/mesa/src/gallium/drivers/r600/sb/sb_valtable.cpp') diff --git a/lib/mesa/src/gallium/drivers/r600/sb/sb_valtable.cpp b/lib/mesa/src/gallium/drivers/r600/sb/sb_valtable.cpp index d31a1b76d..a85537c2a 100644 --- a/lib/mesa/src/gallium/drivers/r600/sb/sb_valtable.cpp +++ b/lib/mesa/src/gallium/drivers/r600/sb/sb_valtable.cpp @@ -212,21 +212,20 @@ void value_table::get_values(vvec& v) { } } -void value::add_use(node* n, use_kind kind, int arg) { +void value::add_use(node* n) { if (0) { sblog << "add_use "; dump::dump_val(this); sblog << " => "; dump::dump_op(n); - sblog << " kind " << kind << " arg " << arg << "\n"; } - uses.push_back(new use_info(n, kind, arg)); + uses.push_back(n); } struct use_node_comp { explicit use_node_comp(const node *n) : n(n) {} - bool operator() (const use_info *u) { - return u->op->hash() == n->hash(); + bool operator() (const node *o) { + return o->hash() == n->hash(); } private: @@ -239,9 +238,7 @@ void value::remove_use(const node *n) { if (it != uses.end()) { - // TODO assert((*it)->kind == kind) ? - // TODO assert((*it)->arg == arg) ? - delete *it; + // We only ever had a pointer, so don't delete it here uses.erase(it); } } @@ -291,12 +288,8 @@ bool value::is_prealloc() { } void value::delete_uses() { - for (uselist::iterator it = uses.begin(); it != uses.end(); ++it) - { - delete *it; - } - - uses.clear(); + // We only ever had pointers, so don't delete them here + uses.erase(uses.begin(), uses.end()); } void ra_constraint::update_values() { -- cgit v1.2.3