diff options
author | Kenneth Graunke <[email protected]> | 2012-01-28 16:58:37 -0800 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2012-01-30 17:44:52 -0800 |
commit | e3b520049675f78065eccbc25c001ea77861c129 (patch) | |
tree | bef7b2bf8bb25cbb2e271685e3434fc64227a940 /src/glsl/ir_variable_refcount.cpp | |
parent | bed20f02a771f43e1c5092254705701c228cfa7f (diff) |
glsl: Rename class variable_entry to ir_variable_refcount_entry.
Exporting a publicly visible class with a generic name like
"variable_entry" via ir_variable_refcount.h is kind of mean.
Many IR transformers would like to define their own "variable_entry"
class. If they accidentally include this header, the compiler/linker
may get confused and try to instantiate the wrong variable_entry class,
leading to bizarre runtime crashes.
The hope is that renaming this one will allow .cpp files to safely
declare and use their own file-scope "variable_entry" classes.
This avoids crashes caused by converting src/glsl to automake.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-and-tested-by: Matt Turner <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glsl/ir_variable_refcount.cpp')
-rw-r--r-- | src/glsl/ir_variable_refcount.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/glsl/ir_variable_refcount.cpp b/src/glsl/ir_variable_refcount.cpp index 7d39abb3682..1633a735744 100644 --- a/src/glsl/ir_variable_refcount.cpp +++ b/src/glsl/ir_variable_refcount.cpp @@ -36,7 +36,7 @@ // constructor -variable_entry::variable_entry(ir_variable *var) +ir_variable_refcount_entry::ir_variable_refcount_entry(ir_variable *var) { this->var = var; assign = NULL; @@ -46,17 +46,17 @@ variable_entry::variable_entry(ir_variable *var) } -variable_entry * +ir_variable_refcount_entry * ir_variable_refcount_visitor::get_variable_entry(ir_variable *var) { assert(var); foreach_iter(exec_list_iterator, iter, this->variable_list) { - variable_entry *entry = (variable_entry *)iter.get(); + ir_variable_refcount_entry *entry = (ir_variable_refcount_entry *)iter.get(); if (entry->var == var) return entry; } - variable_entry *entry = new(mem_ctx) variable_entry(var); + ir_variable_refcount_entry *entry = new(mem_ctx) ir_variable_refcount_entry(var); assert(entry->referenced_count == 0); this->variable_list.push_tail(entry); return entry; @@ -66,7 +66,7 @@ ir_variable_refcount_visitor::get_variable_entry(ir_variable *var) ir_visitor_status ir_variable_refcount_visitor::visit(ir_variable *ir) { - variable_entry *entry = this->get_variable_entry(ir); + ir_variable_refcount_entry *entry = this->get_variable_entry(ir); if (entry) entry->declaration = true; @@ -78,7 +78,7 @@ ir_visitor_status ir_variable_refcount_visitor::visit(ir_dereference_variable *ir) { ir_variable *const var = ir->variable_referenced(); - variable_entry *entry = this->get_variable_entry(var); + ir_variable_refcount_entry *entry = this->get_variable_entry(var); if (entry) entry->referenced_count++; @@ -101,7 +101,7 @@ ir_variable_refcount_visitor::visit_enter(ir_function_signature *ir) ir_visitor_status ir_variable_refcount_visitor::visit_leave(ir_assignment *ir) { - variable_entry *entry; + ir_variable_refcount_entry *entry; entry = this->get_variable_entry(ir->lhs->variable_referenced()); if (entry) { entry->assigned_count++; |