summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-08-24 10:21:25 -0600
committerBrian Paul <brianp@vmware.com>2010-08-24 10:21:27 -0600
commit81137623e55bb003d2479385547028661c71b415 (patch)
treeb52e393f4feda692d14a2d5a7543b2ae77c145b8
parent2eb8b2d3bb68cef1d3fc431debe1b18f6c017aeb (diff)
glsl2: rename local variable_entry class
With MSVC it seems that this class and its constructor is colliding with the one in ir_variable_refcount.cpp. Rename the class here to avoid the collision. This is a bit of a hack. Can the two variable_entry classes be merged and shared?
-rw-r--r--src/glsl/ir_structure_splitting.cpp39
1 files changed, 22 insertions, 17 deletions
diff --git a/src/glsl/ir_structure_splitting.cpp b/src/glsl/ir_structure_splitting.cpp
index 91f6dac23e..ff3ec936eb 100644
--- a/src/glsl/ir_structure_splitting.cpp
+++ b/src/glsl/ir_structure_splitting.cpp
@@ -40,10 +40,14 @@
static bool debug = false;
-class variable_entry : public exec_node
+// XXX using variable_entry2 here to avoid collision (MSVC multiply-defined
+// function) with the variable_entry class seen in ir_variable_refcount.h
+// Perhaps we can use the one in ir_variable_refcount.h and make this class
+// here go away?
+class variable_entry2 : public exec_node
{
public:
- variable_entry(ir_variable *var)
+ variable_entry2(ir_variable *var)
{
this->var = var;
this->whole_structure_access = 0;
@@ -65,6 +69,7 @@ public:
void *mem_ctx;
};
+
class ir_structure_reference_visitor : public ir_hierarchical_visitor {
public:
ir_structure_reference_visitor(void)
@@ -84,7 +89,7 @@ public:
virtual ir_visitor_status visit_enter(ir_assignment *);
virtual ir_visitor_status visit_enter(ir_function_signature *);
- variable_entry *get_variable_entry(ir_variable *var);
+ variable_entry2 *get_variable_entry2(ir_variable *var);
/* List of variable_entry */
exec_list variable_list;
@@ -92,8 +97,8 @@ public:
void *mem_ctx;
};
-variable_entry *
-ir_structure_reference_visitor::get_variable_entry(ir_variable *var)
+variable_entry2 *
+ir_structure_reference_visitor::get_variable_entry2(ir_variable *var)
{
assert(var);
@@ -101,12 +106,12 @@ ir_structure_reference_visitor::get_variable_entry(ir_variable *var)
return NULL;
foreach_iter(exec_list_iterator, iter, this->variable_list) {
- variable_entry *entry = (variable_entry *)iter.get();
+ variable_entry2 *entry = (variable_entry2 *)iter.get();
if (entry->var == var)
return entry;
}
- variable_entry *entry = new(mem_ctx) variable_entry(var);
+ variable_entry2 *entry = new(mem_ctx) variable_entry2(var);
this->variable_list.push_tail(entry);
return entry;
}
@@ -115,7 +120,7 @@ ir_structure_reference_visitor::get_variable_entry(ir_variable *var)
ir_visitor_status
ir_structure_reference_visitor::visit(ir_variable *ir)
{
- variable_entry *entry = this->get_variable_entry(ir);
+ variable_entry2 *entry = this->get_variable_entry2(ir);
if (entry)
entry->declaration = true;
@@ -127,7 +132,7 @@ ir_visitor_status
ir_structure_reference_visitor::visit(ir_dereference_variable *ir)
{
ir_variable *const var = ir->variable_referenced();
- variable_entry *entry = this->get_variable_entry(var);
+ variable_entry2 *entry = this->get_variable_entry2(var);
if (entry)
entry->whole_structure_access++;
@@ -182,13 +187,13 @@ public:
void split_deref(ir_dereference **deref);
void handle_rvalue(ir_rvalue **rvalue);
- variable_entry *get_splitting_entry(ir_variable *var);
+ variable_entry2 *get_splitting_entry(ir_variable *var);
exec_list *variable_list;
void *mem_ctx;
};
-variable_entry *
+variable_entry2 *
ir_structure_splitting_visitor::get_splitting_entry(ir_variable *var)
{
assert(var);
@@ -197,7 +202,7 @@ ir_structure_splitting_visitor::get_splitting_entry(ir_variable *var)
return NULL;
foreach_iter(exec_list_iterator, iter, *this->variable_list) {
- variable_entry *entry = (variable_entry *)iter.get();
+ variable_entry2 *entry = (variable_entry2 *)iter.get();
if (entry->var == var) {
return entry;
}
@@ -217,7 +222,7 @@ ir_structure_splitting_visitor::split_deref(ir_dereference **deref)
if (!deref_var)
return;
- variable_entry *entry = get_splitting_entry(deref_var->var);
+ variable_entry2 *entry = get_splitting_entry(deref_var->var);
if (!entry)
return;
@@ -252,8 +257,8 @@ ir_structure_splitting_visitor::visit_leave(ir_assignment *ir)
{
ir_dereference_variable *lhs_deref = ir->lhs->as_dereference_variable();
ir_dereference_variable *rhs_deref = ir->rhs->as_dereference_variable();
- variable_entry *lhs_entry = lhs_deref ? get_splitting_entry(lhs_deref->var) : NULL;
- variable_entry *rhs_entry = rhs_deref ? get_splitting_entry(rhs_deref->var) : NULL;
+ variable_entry2 *lhs_entry = lhs_deref ? get_splitting_entry(lhs_deref->var) : NULL;
+ variable_entry2 *rhs_entry = rhs_deref ? get_splitting_entry(rhs_deref->var) : NULL;
const glsl_type *type = ir->rhs->type;
if ((lhs_entry || rhs_entry) && !ir->condition) {
@@ -301,7 +306,7 @@ do_structure_splitting(exec_list *instructions)
/* Trim out variables we can't split. */
foreach_iter(exec_list_iterator, iter, refs.variable_list) {
- variable_entry *entry = (variable_entry *)iter.get();
+ variable_entry2 *entry = (variable_entry2 *)iter.get();
if (debug) {
printf("structure %s@%p: decl %d, whole_access %d\n",
@@ -323,7 +328,7 @@ do_structure_splitting(exec_list *instructions)
* components.
*/
foreach_iter(exec_list_iterator, iter, refs.variable_list) {
- variable_entry *entry = (variable_entry *)iter.get();
+ variable_entry2 *entry = (variable_entry2 *)iter.get();
const struct glsl_type *type = entry->var->type;
entry->mem_ctx = talloc_parent(entry->var);