projects
/
profile
/
ivi
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2927b6c
)
glsl: Make the symbol table's add_function just use the function's name.
author
Eric Anholt
<eric@anholt.net>
Fri, 5 Nov 2010 13:08:45 +0000
(06:08 -0700)
committer
Eric Anholt
<eric@anholt.net>
Tue, 30 Nov 2010 01:08:27 +0000
(17:08 -0800)
src/glsl/ast_to_hir.cpp
patch
|
blob
|
history
src/glsl/glsl_symbol_table.cpp
patch
|
blob
|
history
src/glsl/glsl_symbol_table.h
patch
|
blob
|
history
src/glsl/ir_import_prototypes.cpp
patch
|
blob
|
history
src/glsl/ir_reader.cpp
patch
|
blob
|
history
src/glsl/linker.cpp
patch
|
blob
|
history
diff --git
a/src/glsl/ast_to_hir.cpp
b/src/glsl/ast_to_hir.cpp
index
d615b30
..
1f00127
100644
(file)
--- a/
src/glsl/ast_to_hir.cpp
+++ b/
src/glsl/ast_to_hir.cpp
@@
-2495,7
+2495,7
@@
ast_function::hir(exec_list *instructions,
}
} else {
f = new(ctx) ir_function(name);
}
} else {
f = new(ctx) ir_function(name);
- if (!state->symbols->add_function(f
->name, f
)) {
+ if (!state->symbols->add_function(f)) {
/* This function name shadows a non-function use of the same name. */
YYLTYPE loc = this->get_location();
/* This function name shadows a non-function use of the same name. */
YYLTYPE loc = this->get_location();
diff --git
a/src/glsl/glsl_symbol_table.cpp
b/src/glsl/glsl_symbol_table.cpp
index
e9bf89b
..
3b384d8
100644
(file)
--- a/
src/glsl/glsl_symbol_table.cpp
+++ b/
src/glsl/glsl_symbol_table.cpp
@@
-121,18
+121,18
@@
bool glsl_symbol_table::add_type(const char *name, const glsl_type *t)
return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
}
return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
}
-bool glsl_symbol_table::add_function(
const char *name,
ir_function *f)
+bool glsl_symbol_table::add_function(ir_function *f)
{
{
- if (this->language_version == 110 && name_declared_this_scope(name)) {
+ if (this->language_version == 110 && name_declared_this_scope(
f->
name)) {
/* In 1.10, functions and variables have separate namespaces. */
/* In 1.10, functions and variables have separate namespaces. */
- symbol_table_entry *existing = get_entry(name);
+ symbol_table_entry *existing = get_entry(
f->
name);
if ((existing->f == NULL) && (existing->t == NULL)) {
existing->f = f;
return true;
}
}
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
if ((existing->f == NULL) && (existing->t == NULL)) {
existing->f = f;
return true;
}
}
symbol_table_entry *entry = new(mem_ctx) symbol_table_entry(f);
- return _mesa_symbol_table_add_symbol(table, -1, name, entry) == 0;
+ return _mesa_symbol_table_add_symbol(table, -1,
f->
name, entry) == 0;
}
ir_variable *glsl_symbol_table::get_variable(const char *name)
}
ir_variable *glsl_symbol_table::get_variable(const char *name)
diff --git
a/src/glsl/glsl_symbol_table.h
b/src/glsl/glsl_symbol_table.h
index
f26de52
..
883c301
100644
(file)
--- a/
src/glsl/glsl_symbol_table.h
+++ b/
src/glsl/glsl_symbol_table.h
@@
-99,7
+99,7
@@
public:
/*@{*/
bool add_variable(const char *name, ir_variable *v);
bool add_type(const char *name, const glsl_type *t);
/*@{*/
bool add_variable(const char *name, ir_variable *v);
bool add_type(const char *name, const glsl_type *t);
- bool add_function(
const char *name,
ir_function *f);
+ bool add_function(ir_function *f);
/*@}*/
/**
/*@}*/
/**
diff --git
a/src/glsl/ir_import_prototypes.cpp
b/src/glsl/ir_import_prototypes.cpp
index
066137e
..
2bdc8d9
100644
(file)
--- a/
src/glsl/ir_import_prototypes.cpp
+++ b/
src/glsl/ir_import_prototypes.cpp
@@
-64,7
+64,7
@@
public:
/* Add the new function to the symbol table.
*/
/* Add the new function to the symbol table.
*/
- this->symbols->add_function(this->function
->name, this->function
);
+ this->symbols->add_function(this->function);
}
return visit_continue;
}
}
return visit_continue;
}
diff --git
a/src/glsl/ir_reader.cpp
b/src/glsl/ir_reader.cpp
index
7a22a94
..
446776c
100644
(file)
--- a/
src/glsl/ir_reader.cpp
+++ b/
src/glsl/ir_reader.cpp
@@
-221,7
+221,7
@@
read_function(_mesa_glsl_parse_state *st, s_list *list, bool skip_body)
ir_function *f = st->symbols->get_function(name->value());
if (f == NULL) {
f = new(ctx) ir_function(name->value());
ir_function *f = st->symbols->get_function(name->value());
if (f == NULL) {
f = new(ctx) ir_function(name->value());
- added = st->symbols->add_function(f
->name, f
);
+ added = st->symbols->add_function(f);
assert(added);
}
assert(added);
}
diff --git
a/src/glsl/linker.cpp
b/src/glsl/linker.cpp
index
616ec78
..
7aa9406
100644
(file)
--- a/
src/glsl/linker.cpp
+++ b/
src/glsl/linker.cpp
@@
-546,7
+546,7
@@
populate_symbol_table(gl_shader *sh)
ir_function *func;
if ((func = inst->as_function()) != NULL) {
ir_function *func;
if ((func = inst->as_function()) != NULL) {
- sh->symbols->add_function(func
->name, func
);
+ sh->symbols->add_function(func);
} else if ((var = inst->as_variable()) != NULL) {
sh->symbols->add_variable(var->name, var);
}
} else if ((var = inst->as_variable()) != NULL) {
sh->symbols->add_variable(var->name, var);
}