Commit 396527c9 by Jonah Ryan-Davis Committed by Commit Bot

Autogenerated kFunction* variables detected as mutable constants

The android binary size is increased incorrectly because the autogen kFunction* variables are detected as mutable constants. Rename them to function* to workaround this. Bug: angleproject:3823 Change-Id: Ia335d1ae97ce5276a0ff8b9e432b53181cc36680 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1762494Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
parent 213ad6bd
{ {
"src/compiler/translator/ImmutableString_autogen.cpp": "src/compiler/translator/ImmutableString_autogen.cpp":
"0a96956b0168817b28032a567f606940", "49acb8114f600d8f099a826afcb28935",
"src/compiler/translator/ParseContext_autogen.h": "src/compiler/translator/ParseContext_autogen.h":
"48f878f5878e8ab239af7c14e5878b62", "48f878f5878e8ab239af7c14e5878b62",
"src/compiler/translator/SymbolTable_autogen.cpp": "src/compiler/translator/SymbolTable_autogen.cpp":
"d596cedd9f12e0c91fea4fe0d04d207a", "bb98f37ed21e89086cc0b9a392a1b168",
"src/compiler/translator/SymbolTable_autogen.h": "src/compiler/translator/SymbolTable_autogen.h":
"bdb3c8eab0d48267a2f264e3af635e1a", "bdb3c8eab0d48267a2f264e3af635e1a",
"src/compiler/translator/builtin_function_declarations.txt": "src/compiler/translator/builtin_function_declarations.txt":
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
"src/compiler/translator/builtin_variables.json": "src/compiler/translator/builtin_variables.json":
"779ab43201aac2ac26017e87331c80d1", "779ab43201aac2ac26017e87331c80d1",
"src/compiler/translator/gen_builtin_symbols.py": "src/compiler/translator/gen_builtin_symbols.py":
"70805846a33bf9b0c47639c80d01f0f8", "f8f1c8cc208f5f1bb64cf6921e28e966",
"src/compiler/translator/tree_util/BuiltIn_autogen.h": "src/compiler/translator/tree_util/BuiltIn_autogen.h":
"12f125f1b65be3379b08d2cf831a2e3a", "12f125f1b65be3379b08d2cf831a2e3a",
"src/tests/compiler_tests/ImmutableString_test_autogen.cpp": "src/tests/compiler_tests/ImmutableString_test_autogen.cpp":
"99468acdcf2bad59fd9f6a7519bcf390" "2769eb6b659d8fa676311157f947aecd"
} }
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -1020,7 +1020,7 @@ def get_variable_name_to_store_parameters(parameters): ...@@ -1020,7 +1020,7 @@ def get_variable_name_to_store_parameters(parameters):
def define_constexpr_variable(template_args, variable_declarations): def define_constexpr_variable(template_args, variable_declarations):
template_variable_declaration = 'constexpr const TVariable var_{name_with_suffix}(BuiltInId::{name_with_suffix}, BuiltInName::{name}, SymbolType::BuiltIn, TExtension::{extension}, {type});' template_variable_declaration = 'constexpr const TVariable kVar_{name_with_suffix}(BuiltInId::{name_with_suffix}, BuiltInName::{name}, SymbolType::BuiltIn, TExtension::{extension}, {type});'
variable_declarations.append(template_variable_declaration.format(**template_args)) variable_declarations.append(template_variable_declaration.format(**template_args))
...@@ -1179,7 +1179,7 @@ def process_single_function_group( ...@@ -1179,7 +1179,7 @@ def process_single_function_group(
template_mangled_if = """if (name == BuiltInName::{unique_name}{extension_condition}) template_mangled_if = """if (name == BuiltInName::{unique_name}{extension_condition})
{{ {{
return &BuiltInFunction::kFunction_{unique_name}; return &BuiltInFunction::function_{unique_name};
}}""" }}"""
mangled_if = template_mangled_if.format(**template_args) mangled_if = template_mangled_if.format(**template_args)
get_builtin_if_statements.add_obj(essl_level, glsl_level, condition, get_builtin_if_statements.add_obj(essl_level, glsl_level, condition,
...@@ -1213,7 +1213,7 @@ def process_single_function_group( ...@@ -1213,7 +1213,7 @@ def process_single_function_group(
define_constexpr_variable(param_template_args, variable_declarations) define_constexpr_variable(param_template_args, variable_declarations)
defined_parameter_names.add(unique_param_name) defined_parameter_names.add(unique_param_name)
parameters_list.append( parameters_list.append(
'&BuiltInVariable::var_{name_with_suffix}'.format(**param_template_args)) '&BuiltInVariable::kVar_{name_with_suffix}'.format(**param_template_args))
template_args['parameters_var_name'] = get_variable_name_to_store_parameters( template_args['parameters_var_name'] = get_variable_name_to_store_parameters(
parameters) parameters)
...@@ -1229,7 +1229,7 @@ def process_single_function_group( ...@@ -1229,7 +1229,7 @@ def process_single_function_group(
'parameters_var_name']] = template_parameter_list_declaration.format( 'parameters_var_name']] = template_parameter_list_declaration.format(
**template_args) **template_args)
template_function_declaration = 'constexpr const TFunction kFunction_{unique_name}(BuiltInId::{human_readable_name}, BuiltInName::{name_with_suffix}, TExtension::{extension}, BuiltInParameters::{parameters_var_name}, {param_count}, {return_type}, EOp{op}, {known_to_not_have_side_effects});' template_function_declaration = 'constexpr const TFunction function_{unique_name}(BuiltInId::{human_readable_name}, BuiltInName::{name_with_suffix}, TExtension::{extension}, BuiltInParameters::{parameters_var_name}, {param_count}, {return_type}, EOp{op}, {known_to_not_have_side_effects});'
function_declarations.append(template_function_declaration.format(**template_args)) function_declarations.append(template_function_declaration.format(**template_args))
template_mangled_name_declaration = 'constexpr const ImmutableString {unique_name}("{mangled_name}");' template_mangled_name_declaration = 'constexpr const ImmutableString {unique_name}("{mangled_name}");'
...@@ -1407,7 +1407,7 @@ def process_single_variable_group(condition, group_name, group, builtin_id_decla ...@@ -1407,7 +1407,7 @@ def process_single_variable_group(condition, group_name, group, builtin_id_decla
template_get_variable_definition = """const TVariable *{name_with_suffix}() template_get_variable_definition = """const TVariable *{name_with_suffix}()
{{ {{
return &var_{name_with_suffix}; return &kVar_{name_with_suffix};
}} }}
""" """
get_variable_definitions.append( get_variable_definitions.append(
...@@ -1416,7 +1416,7 @@ def process_single_variable_group(condition, group_name, group, builtin_id_decla ...@@ -1416,7 +1416,7 @@ def process_single_variable_group(condition, group_name, group, builtin_id_decla
if level != 'GLSL_BUILTINS': if level != 'GLSL_BUILTINS':
template_name_if = """if (name == BuiltInName::{name}) template_name_if = """if (name == BuiltInName::{name})
{{ {{
return &BuiltInVariable::var_{name_with_suffix}; return &BuiltInVariable::kVar_{name_with_suffix};
}}""" }}"""
name_if = template_name_if.format(**template_args) name_if = template_name_if.format(**template_args)
get_builtin_if_statements.add_obj(level, 'COMMON_BUILTINS', condition, get_builtin_if_statements.add_obj(level, 'COMMON_BUILTINS', condition,
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment