Commit c41095db by Gabriel Dos Reis Committed by Jason Merrill

semantics.c (constexpr_call): New datatype.

	* semantics.c (constexpr_call): New datatype.
	(constexpr_call_table): New global table.
	(constexpr_call_hash): New.
	(constexpr_call_equal): Likewise.
	(maybe_initialize_constexpr_call_table): Likewise.
	(lookup_parameter_binding): Likewise.
	(cxx_eval_builtin_function_call): Likewise.
	(cxx_bind_parameters_in_call): Likewise.
	(cxx_eval_call_expression): Likewise.
	(cxx_eval_unary_expression): Likewise.
	(cxx_eval_binary_expression): Likewise.
	(cxx_eval_conditional_expression): Likewise.
	(cxx_eval_array_reference): Likewise.
	(cxx_eval_component_reference): Likewise.
	(cxx_eval_logical_expression): Likewise.
	(cxx_eval_object_construction): Likewise.
	(cxx_eval_constant_expression): Likewise.
	(cxx_eval_indirect_ref): Likewise.
	(cxx_constant_value): Likewise.
	(cxx_eval_bare_aggregate): Likewise.
	(adjust_temp_type): New.
	(reduced_constant_expression_p): New.
	(verify_constant): New.
	(cxx_eval_vec_init, cxx_eval_vec_init_1): New.
	(cxx_eval_outermost_constant_expr): New.
	(maybe_constant_value, maybe_constant_init): New.
	(cxx_eval_constant_expression): Use them.
	* cp-tree.h: Declare fns.

Co-Authored-By: Jason Merrill <jason@redhat.com>

From-SVN: r166166
parent 66e61a34
2010-11-01 Gabriel Dos Reis <gdr@cse.tamu.edu>
Jason Merrill <jason@redhat.com>
* semantics.c (constexpr_call): New datatype.
(constexpr_call_table): New global table.
(constexpr_call_hash): New.
(constexpr_call_equal): Likewise.
(maybe_initialize_constexpr_call_table): Likewise.
(lookup_parameter_binding): Likewise.
(cxx_eval_builtin_function_call): Likewise.
(cxx_bind_parameters_in_call): Likewise.
(cxx_eval_call_expression): Likewise.
(cxx_eval_unary_expression): Likewise.
(cxx_eval_binary_expression): Likewise.
(cxx_eval_conditional_expression): Likewise.
(cxx_eval_array_reference): Likewise.
(cxx_eval_component_reference): Likewise.
(cxx_eval_logical_expression): Likewise.
(cxx_eval_object_construction): Likewise.
(cxx_eval_constant_expression): Likewise.
(cxx_eval_indirect_ref): Likewise.
(cxx_constant_value): Likewise.
(cxx_eval_bare_aggregate): Likewise.
(adjust_temp_type): New.
(reduced_constant_expression_p): New.
(verify_constant): New.
(cxx_eval_vec_init, cxx_eval_vec_init_1): New.
(cxx_eval_outermost_constant_expr): New.
(maybe_constant_value, maybe_constant_init): New.
(cxx_eval_constant_expression): Use them.
* pt.c (iterative_hash_template_arg): No longer static.
* cp-tree.h: Declare fns.
* cp-tree.h (register_constexpr_fundef): Declare.
* decl.c (maybe_save_function_definition): New.
(finish_function): Use it.
......
......@@ -5122,6 +5122,7 @@ extern tree get_template_innermost_arguments (const_tree);
extern tree get_template_argument_pack_elems (const_tree);
extern tree get_function_template_decl (const_tree);
extern tree resolve_nondeduced_context (tree);
extern hashval_t iterative_hash_template_arg (tree arg, hashval_t val);
/* in repo.c */
extern void init_repo (void);
......@@ -5254,6 +5255,10 @@ extern bool literal_type_p (tree);
extern tree validate_constexpr_fundecl (tree);
extern tree register_constexpr_fundef (tree, tree);
extern tree ensure_literal_type_for_constexpr_object (tree);
extern tree cxx_constant_value (tree);
extern tree maybe_constant_value (tree);
extern tree maybe_constant_init (tree);
extern bool reduced_constant_expression_p (tree);
enum {
BCS_NO_SCOPE = 1,
......
......@@ -187,7 +187,6 @@ static tree tsubst_decl (tree, tree, tsubst_flags_t);
static void perform_typedefs_access_check (tree tmpl, tree targs);
static void append_type_to_template_for_access_check_1 (tree, tree, tree,
location_t);
static hashval_t iterative_hash_template_arg (tree arg, hashval_t val);
static tree listify (tree);
static tree listify_autos (tree, tree);
......@@ -1458,7 +1457,7 @@ hash_specialization (const void *p)
/* Recursively calculate a hash value for a template argument ARG, for use
in the hash tables of template specializations. */
static hashval_t
hashval_t
iterative_hash_template_arg (tree arg, hashval_t val)
{
unsigned HOST_WIDE_INT i;
......
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