Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
3a978d72
Commit
3a978d72
authored
Jun 19, 2003
by
Nathanael Nerode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pt.c: Convert to ISO C.
* pt.c: Convert to ISO C. * semantics.c: Convert to ISO C. From-SVN: r68174
parent
7cbd1918
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
399 additions
and
664 deletions
+399
-664
gcc/cp/ChangeLog
+5
-0
gcc/cp/pt.c
+288
-460
gcc/cp/semantics.c
+106
-204
No files found.
gcc/cp/ChangeLog
View file @
3a978d72
2003
-
06
-
18
Nathanael
Nerode
<
neroden
@
gcc.gnu.org
>
*
pt.c
:
Convert
to
ISO
C.
*
semantics.c
:
Convert
to
ISO
C.
2003
-
06
-
18
Nathan
Sidwell
<
nathan
@
codesourcery.com
>
2003
-
06
-
18
Nathan
Sidwell
<
nathan
@
codesourcery.com
>
*
cp
-tree.h
(
comp_except_specs
,
compparms
,
cp_has_mutable_p
,
*
cp
-tree.h
(
comp_except_specs
,
compparms
,
cp_has_mutable_p
,
...
...
gcc/cp/pt.c
View file @
3a978d72
...
@@ -45,7 +45,7 @@ Boston, MA 02111-1307, USA. */
...
@@ -45,7 +45,7 @@ Boston, MA 02111-1307, USA. */
/* The type of functions taking a tree, and some additional data, and
/* The type of functions taking a tree, and some additional data, and
returning an int. */
returning an int. */
typedef
int
(
*
tree_fn_t
)
PARAMS
((
tree
,
void
*
)
);
typedef
int
(
*
tree_fn_t
)
(
tree
,
void
*
);
/* The PENDING_TEMPLATES is a TREE_LIST of templates whose
/* The PENDING_TEMPLATES is a TREE_LIST of templates whose
instantiations have been deferred, either because their definitions
instantiations have been deferred, either because their definitions
...
@@ -88,88 +88,83 @@ static htab_t local_specializations;
...
@@ -88,88 +88,83 @@ static htab_t local_specializations;
#define GTB_IGNORE_TYPE 2
/* We don't need to try to unify the current
#define GTB_IGNORE_TYPE 2
/* We don't need to try to unify the current
type with the desired type. */
type with the desired type. */
static
void
push_access_scope_real
PARAMS
((
tree
,
tree
,
tree
));
static
void
push_access_scope_real
(
tree
,
tree
,
tree
);
static
void
push_access_scope
PARAMS
((
tree
));
static
void
push_access_scope
(
tree
);
static
void
pop_access_scope
PARAMS
((
tree
));
static
void
pop_access_scope
(
tree
);
static
int
resolve_overloaded_unification
PARAMS
((
tree
,
tree
,
tree
,
tree
,
static
int
resolve_overloaded_unification
(
tree
,
tree
,
tree
,
tree
,
unification_kind_t
,
int
));
unification_kind_t
,
int
);
static
int
try_one_overload
PARAMS
((
tree
,
tree
,
tree
,
tree
,
tree
,
static
int
try_one_overload
(
tree
,
tree
,
tree
,
tree
,
tree
,
unification_kind_t
,
int
));
unification_kind_t
,
int
);
static
int
unify
PARAMS
((
tree
,
tree
,
tree
,
tree
,
int
));
static
int
unify
(
tree
,
tree
,
tree
,
tree
,
int
);
static
void
add_pending_template
PARAMS
((
tree
));
static
void
add_pending_template
(
tree
);
static
void
reopen_tinst_level
PARAMS
((
tree
));
static
void
reopen_tinst_level
(
tree
);
static
tree
classtype_mangled_name
PARAMS
((
tree
));
static
tree
classtype_mangled_name
(
tree
);
static
char
*
mangle_class_name_for_template
PARAMS
((
const
char
*
,
static
char
*
mangle_class_name_for_template
(
const
char
*
,
tree
,
tree
);
tree
,
tree
));
static
tree
tsubst_initializer_list
(
tree
,
tree
);
static
tree
tsubst_initializer_list
PARAMS
((
tree
,
tree
));
static
int
list_eq
(
tree
,
tree
);
static
int
list_eq
PARAMS
((
tree
,
tree
));
static
tree
get_class_bindings
(
tree
,
tree
,
tree
);
static
tree
get_class_bindings
PARAMS
((
tree
,
tree
,
tree
));
static
tree
coerce_template_parms
(
tree
,
tree
,
tree
,
tsubst_flags_t
,
int
);
static
tree
coerce_template_parms
PARAMS
((
tree
,
tree
,
tree
,
static
void
tsubst_enum
(
tree
,
tree
,
tree
);
tsubst_flags_t
,
int
));
static
tree
add_to_template_args
(
tree
,
tree
);
static
void
tsubst_enum
PARAMS
((
tree
,
tree
,
tree
));
static
tree
add_outermost_template_args
(
tree
,
tree
);
static
tree
add_to_template_args
PARAMS
((
tree
,
tree
));
static
bool
check_instantiated_args
(
tree
,
tree
,
tsubst_flags_t
);
static
tree
add_outermost_template_args
PARAMS
((
tree
,
tree
));
static
int
maybe_adjust_types_for_deduction
(
unification_kind_t
,
tree
*
,
tree
*
);
static
bool
check_instantiated_args
PARAMS
((
tree
,
tree
,
tsubst_flags_t
));
static
int
type_unification_real
(
tree
,
tree
,
tree
,
tree
,
static
int
maybe_adjust_types_for_deduction
PARAMS
((
unification_kind_t
,
tree
*
,
int
,
unification_kind_t
,
int
,
int
);
tree
*
));
static
void
note_template_header
(
int
);
static
int
type_unification_real
PARAMS
((
tree
,
tree
,
tree
,
tree
,
static
tree
maybe_fold_nontype_arg
(
tree
);
int
,
unification_kind_t
,
int
,
int
));
static
void
maybe_fold_nontype_args
(
tree
);
static
void
note_template_header
PARAMS
((
int
));
static
tree
convert_nontype_argument
(
tree
,
tree
);
static
tree
maybe_fold_nontype_arg
PARAMS
((
tree
));
static
tree
convert_template_argument
(
tree
,
tree
,
tree
,
static
void
maybe_fold_nontype_args
PARAMS
((
tree
));
tsubst_flags_t
,
int
,
tree
);
static
tree
convert_nontype_argument
PARAMS
((
tree
,
tree
));
static
tree
get_bindings_overload
(
tree
,
tree
,
tree
);
static
tree
convert_template_argument
PARAMS
((
tree
,
tree
,
tree
,
static
int
for_each_template_parm
(
tree
,
tree_fn_t
,
void
*
,
htab_t
);
tsubst_flags_t
,
int
,
tree
));
static
tree
build_template_parm_index
(
int
,
int
,
int
,
tree
,
tree
);
static
tree
get_bindings_overload
PARAMS
((
tree
,
tree
,
tree
));
static
int
inline_needs_template_parms
(
tree
);
static
int
for_each_template_parm
PARAMS
((
tree
,
tree_fn_t
,
void
*
,
htab_t
));
static
void
push_inline_template_parms_recursive
(
tree
,
int
);
static
tree
build_template_parm_index
PARAMS
((
int
,
int
,
int
,
tree
,
tree
));
static
tree
retrieve_specialization
(
tree
,
tree
);
static
int
inline_needs_template_parms
PARAMS
((
tree
));
static
tree
retrieve_local_specialization
(
tree
);
static
void
push_inline_template_parms_recursive
PARAMS
((
tree
,
int
));
static
tree
register_specialization
(
tree
,
tree
,
tree
);
static
tree
retrieve_specialization
PARAMS
((
tree
,
tree
));
static
void
register_local_specialization
(
tree
,
tree
);
static
tree
retrieve_local_specialization
PARAMS
((
tree
));
static
int
unregister_specialization
(
tree
,
tree
);
static
tree
register_specialization
PARAMS
((
tree
,
tree
,
tree
));
static
tree
reduce_template_parm_level
(
tree
,
tree
,
int
);
static
void
register_local_specialization
PARAMS
((
tree
,
tree
));
static
tree
build_template_decl
(
tree
,
tree
);
static
int
unregister_specialization
PARAMS
((
tree
,
tree
));
static
int
mark_template_parm
(
tree
,
void
*
);
static
tree
reduce_template_parm_level
PARAMS
((
tree
,
tree
,
int
));
static
int
template_parm_this_level_p
(
tree
,
void
*
);
static
tree
build_template_decl
PARAMS
((
tree
,
tree
));
static
tree
tsubst_friend_function
(
tree
,
tree
);
static
int
mark_template_parm
PARAMS
((
tree
,
void
*
));
static
tree
tsubst_friend_class
(
tree
,
tree
);
static
int
template_parm_this_level_p
PARAMS
((
tree
,
void
*
));
static
int
can_complete_type_without_circularity
(
tree
);
static
tree
tsubst_friend_function
PARAMS
((
tree
,
tree
));
static
tree
get_bindings_real
(
tree
,
tree
,
tree
,
int
,
int
,
int
);
static
tree
tsubst_friend_class
PARAMS
((
tree
,
tree
));
static
int
template_decl_level
(
tree
);
static
int
can_complete_type_without_circularity
PARAMS
((
tree
));
static
int
check_cv_quals_for_unify
(
int
,
tree
,
tree
);
static
tree
get_bindings_real
PARAMS
((
tree
,
tree
,
tree
,
int
,
int
,
int
));
static
tree
tsubst_template_arg_vector
(
tree
,
tree
,
tsubst_flags_t
);
static
int
template_decl_level
PARAMS
((
tree
));
static
tree
tsubst_template_parms
(
tree
,
tree
,
tsubst_flags_t
);
static
int
check_cv_quals_for_unify
PARAMS
((
int
,
tree
,
tree
));
static
void
regenerate_decl_from_template
(
tree
,
tree
);
static
tree
tsubst_template_arg_vector
PARAMS
((
tree
,
tree
,
tsubst_flags_t
));
static
tree
most_specialized
(
tree
,
tree
,
tree
);
static
tree
tsubst_template_parms
PARAMS
((
tree
,
tree
,
tsubst_flags_t
));
static
tree
most_specialized_class
(
tree
,
tree
);
static
void
regenerate_decl_from_template
PARAMS
((
tree
,
tree
));
static
int
template_class_depth_real
(
tree
,
int
);
static
tree
most_specialized
PARAMS
((
tree
,
tree
,
tree
));
static
tree
tsubst_aggr_type
(
tree
,
tree
,
tsubst_flags_t
,
tree
,
int
);
static
tree
most_specialized_class
PARAMS
((
tree
,
tree
));
static
tree
tsubst_decl
(
tree
,
tree
,
tree
,
tsubst_flags_t
);
static
int
template_class_depth_real
PARAMS
((
tree
,
int
));
static
tree
tsubst_arg_types
(
tree
,
tree
,
tsubst_flags_t
,
tree
);
static
tree
tsubst_aggr_type
PARAMS
((
tree
,
tree
,
tsubst_flags_t
,
tree
,
int
));
static
tree
tsubst_function_type
(
tree
,
tree
,
tsubst_flags_t
,
tree
);
static
tree
tsubst_decl
PARAMS
((
tree
,
tree
,
tree
,
tsubst_flags_t
));
static
void
check_specialization_scope
(
void
);
static
tree
tsubst_arg_types
PARAMS
((
tree
,
tree
,
tsubst_flags_t
,
tree
));
static
tree
process_partial_specialization
(
tree
);
static
tree
tsubst_function_type
PARAMS
((
tree
,
tree
,
tsubst_flags_t
,
tree
));
static
void
set_current_access_from_decl
(
tree
);
static
void
check_specialization_scope
PARAMS
((
void
));
static
void
check_default_tmpl_args
(
tree
,
tree
,
int
,
int
);
static
tree
process_partial_specialization
PARAMS
((
tree
));
static
tree
tsubst_call_declarator_parms
(
tree
,
tree
,
tsubst_flags_t
,
tree
);
static
void
set_current_access_from_decl
PARAMS
((
tree
));
static
tree
get_template_base_recursive
(
tree
,
tree
,
tree
,
tree
,
tree
,
int
);
static
void
check_default_tmpl_args
PARAMS
((
tree
,
tree
,
int
,
int
));
static
tree
get_template_base
(
tree
,
tree
,
tree
,
tree
);
static
tree
tsubst_call_declarator_parms
PARAMS
((
tree
,
tree
,
static
int
verify_class_unification
(
tree
,
tree
,
tree
);
tsubst_flags_t
,
tree
));
static
tree
try_class_unification
(
tree
,
tree
,
tree
,
tree
);
static
tree
get_template_base_recursive
PARAMS
((
tree
,
tree
,
static
int
coerce_template_template_parms
(
tree
,
tree
,
tsubst_flags_t
,
tree
,
tree
,
tree
,
int
));
tree
,
tree
);
static
tree
get_template_base
PARAMS
((
tree
,
tree
,
tree
,
tree
));
static
tree
determine_specialization
(
tree
,
tree
,
tree
*
,
int
);
static
int
verify_class_unification
PARAMS
((
tree
,
tree
,
tree
));
static
int
template_args_equal
(
tree
,
tree
);
static
tree
try_class_unification
PARAMS
((
tree
,
tree
,
tree
,
tree
));
static
void
tsubst_default_arguments
(
tree
);
static
int
coerce_template_template_parms
PARAMS
((
tree
,
tree
,
tsubst_flags_t
,
static
tree
for_each_template_parm_r
(
tree
*
,
int
*
,
void
*
);
tree
,
tree
));
static
tree
copy_default_args_to_explicit_spec_1
(
tree
,
tree
);
static
tree
determine_specialization
PARAMS
((
tree
,
tree
,
tree
*
,
int
));
static
void
copy_default_args_to_explicit_spec
(
tree
);
static
int
template_args_equal
PARAMS
((
tree
,
tree
));
static
int
invalid_nontype_parm_type_p
(
tree
,
tsubst_flags_t
);
static
void
tsubst_default_arguments
PARAMS
((
tree
));
static
tree
for_each_template_parm_r
PARAMS
((
tree
*
,
int
*
,
void
*
));
static
tree
copy_default_args_to_explicit_spec_1
PARAMS
((
tree
,
tree
));
static
void
copy_default_args_to_explicit_spec
PARAMS
((
tree
));
static
int
invalid_nontype_parm_type_p
PARAMS
((
tree
,
tsubst_flags_t
));
static
int
eq_local_specializations
(
const
void
*
,
const
void
*
);
static
int
eq_local_specializations
(
const
void
*
,
const
void
*
);
static
bool
dependent_type_p_r
(
tree
);
static
bool
dependent_type_p_r
(
tree
);
static
bool
dependent_template_id_p
(
tree
,
tree
);
static
bool
dependent_template_id_p
(
tree
,
tree
);
...
@@ -186,8 +181,7 @@ static tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, tree);
...
@@ -186,8 +181,7 @@ static tree tsubst_copy_and_build (tree, tree, tsubst_flags_t, tree);
this is used instead of the context of T. */
this is used instead of the context of T. */
void
void
push_access_scope_real
(
t
,
args
,
context
)
push_access_scope_real
(
tree
t
,
tree
args
,
tree
context
)
tree
t
,
args
,
context
;
{
{
if
(
TREE_CODE
(
t
)
==
FUNCTION_DECL
||
DECL_FUNCTION_TEMPLATE_P
(
t
))
if
(
TREE_CODE
(
t
)
==
FUNCTION_DECL
||
DECL_FUNCTION_TEMPLATE_P
(
t
))
{
{
...
@@ -234,8 +228,7 @@ push_access_scope_real (t, args, context)
...
@@ -234,8 +228,7 @@ push_access_scope_real (t, args, context)
/* Like push_access_scope_real, but always uses DECL_CONTEXT. */
/* Like push_access_scope_real, but always uses DECL_CONTEXT. */
void
void
push_access_scope
(
t
)
push_access_scope
(
tree
t
)
tree
t
;
{
{
push_access_scope_real
(
t
,
NULL_TREE
,
NULL_TREE
);
push_access_scope_real
(
t
,
NULL_TREE
,
NULL_TREE
);
}
}
...
@@ -244,8 +237,7 @@ push_access_scope (t)
...
@@ -244,8 +237,7 @@ push_access_scope (t)
are processing. */
are processing. */
void
void
pop_access_scope
(
t
)
pop_access_scope
(
tree
t
)
tree
t
;
{
{
if
(
TREE_CODE
(
t
)
==
FUNCTION_DECL
||
DECL_FUNCTION_TEMPLATE_P
(
t
))
if
(
TREE_CODE
(
t
)
==
FUNCTION_DECL
||
DECL_FUNCTION_TEMPLATE_P
(
t
))
{
{
...
@@ -265,8 +257,7 @@ pop_access_scope (t)
...
@@ -265,8 +257,7 @@ pop_access_scope (t)
itself is returned. */
itself is returned. */
tree
tree
finish_member_template_decl
(
decl
)
finish_member_template_decl
(
tree
decl
)
tree
decl
;
{
{
if
(
decl
==
error_mark_node
)
if
(
decl
==
error_mark_node
)
return
error_mark_node
;
return
error_mark_node
;
...
@@ -326,9 +317,7 @@ finish_member_template_decl (decl)
...
@@ -326,9 +317,7 @@ finish_member_template_decl (decl)
always safe. */
always safe. */
static
int
static
int
template_class_depth_real
(
type
,
count_specializations
)
template_class_depth_real
(
tree
type
,
int
count_specializations
)
tree
type
;
int
count_specializations
;
{
{
int
depth
;
int
depth
;
...
@@ -365,8 +354,7 @@ template_class_depth_real (type, count_specializations)
...
@@ -365,8 +354,7 @@ template_class_depth_real (type, count_specializations)
the depth. */
the depth. */
int
int
template_class_depth
(
type
)
template_class_depth
(
tree
type
)
tree
type
;
{
{
return
template_class_depth_real
(
type
,
/*count_specializations=*/
0
);
return
template_class_depth_real
(
type
,
/*count_specializations=*/
0
);
}
}
...
@@ -375,8 +363,7 @@ template_class_depth (type)
...
@@ -375,8 +363,7 @@ template_class_depth (type)
needs us to push template parms. */
needs us to push template parms. */
static
int
static
int
inline_needs_template_parms
(
decl
)
inline_needs_template_parms
(
tree
decl
)
tree
decl
;
{
{
if
(
!
DECL_TEMPLATE_INFO
(
decl
))
if
(
!
DECL_TEMPLATE_INFO
(
decl
))
return
0
;
return
0
;
...
@@ -391,9 +378,7 @@ inline_needs_template_parms (decl)
...
@@ -391,9 +378,7 @@ inline_needs_template_parms (decl)
innermost first. */
innermost first. */
static
void
static
void
push_inline_template_parms_recursive
(
parmlist
,
levels
)
push_inline_template_parms_recursive
(
tree
parmlist
,
int
levels
)
tree
parmlist
;
int
levels
;
{
{
tree
parms
=
TREE_VALUE
(
parmlist
);
tree
parms
=
TREE_VALUE
(
parmlist
);
int
i
;
int
i
;
...
@@ -446,8 +431,7 @@ push_inline_template_parms_recursive (parmlist, levels)
...
@@ -446,8 +431,7 @@ push_inline_template_parms_recursive (parmlist, levels)
a friend template defined in a class definition. */
a friend template defined in a class definition. */
void
void
maybe_begin_member_template_processing
(
decl
)
maybe_begin_member_template_processing
(
tree
decl
)
tree
decl
;
{
{
tree
parms
;
tree
parms
;
int
levels
=
0
;
int
levels
=
0
;
...
@@ -479,7 +463,7 @@ maybe_begin_member_template_processing (decl)
...
@@ -479,7 +463,7 @@ maybe_begin_member_template_processing (decl)
/* Undo the effects of begin_member_template_processing. */
/* Undo the effects of begin_member_template_processing. */
void
void
maybe_end_member_template_processing
()
maybe_end_member_template_processing
(
void
)
{
{
int
i
;
int
i
;
...
@@ -513,8 +497,7 @@ maybe_end_member_template_processing ()
...
@@ -513,8 +497,7 @@ maybe_end_member_template_processing ()
C<int>::f(U)' is considered a member template. */
C<int>::f(U)' is considered a member template. */
int
int
is_member_template
(
t
)
is_member_template
(
tree
t
)
tree
t
;
{
{
if
(
!
DECL_FUNCTION_TEMPLATE_P
(
t
))
if
(
!
DECL_FUNCTION_TEMPLATE_P
(
t
))
/* Anything that isn't a function or a template function is
/* Anything that isn't a function or a template function is
...
@@ -539,8 +522,7 @@ is_member_template (t)
...
@@ -539,8 +522,7 @@ is_member_template (t)
a member template. */
a member template. */
int
int
is_member_template_class (t)
is_member_template_class (tree t)
tree t;
{
{
if (!DECL_CLASS_TEMPLATE_P (t))
if (!DECL_CLASS_TEMPLATE_P (t))
/* Anything that isn't a class template, is certainly not a member
/* Anything that isn't a class template, is certainly not a member
...
@@ -564,9 +546,7 @@ is_member_template_class (t)
...
@@ -564,9 +546,7 @@ is_member_template_class (t)
but has as its innermost set of arguments the EXTRA_ARGS. */
but has as its innermost set of arguments the EXTRA_ARGS. */
static
tree
static
tree
add_to_template_args
(
args
,
extra_args
)
add_to_template_args
(
tree
args
,
tree
extra_args
)
tree
args
;
tree
extra_args
;
{
{
tree
new_args
;
tree
new_args
;
int
extra_depth
;
int
extra_depth
;
...
@@ -593,9 +573,7 @@ add_to_template_args (args, extra_args)
...
@@ -593,9 +573,7 @@ add_to_template_args (args, extra_args)
partial instantiation. */
partial instantiation. */
static
tree
static
tree
add_outermost_template_args
(
args
,
extra_args
)
add_outermost_template_args
(
tree
args
,
tree
extra_args
)
tree
args
;
tree
extra_args
;
{
{
tree
new_args
;
tree
new_args
;
...
@@ -623,9 +601,7 @@ add_outermost_template_args (args, extra_args)
...
@@ -623,9 +601,7 @@ add_outermost_template_args (args, extra_args)
/* Return the N levels of innermost template arguments from the ARGS. */
/* Return the N levels of innermost template arguments from the ARGS. */
tree
tree
get_innermost_template_args
(
args
,
n
)
get_innermost_template_args
(
tree
args
,
int
n
)
tree
args
;
int
n
;
{
{
tree
new_args
;
tree
new_args
;
int
extra_levels
;
int
extra_levels
;
...
@@ -657,7 +633,7 @@ get_innermost_template_args (args, n)
...
@@ -657,7 +633,7 @@ get_innermost_template_args (args, n)
the parms. */
the parms. */
void
void
begin_template_parm_list
()
begin_template_parm_list
(
void
)
{
{
/* We use a non-tag-transparent scope here, which causes pushtag to
/* We use a non-tag-transparent scope here, which causes pushtag to
put tags in this scope, rather than in the enclosing class or
put tags in this scope, rather than in the enclosing class or
...
@@ -683,7 +659,7 @@ begin_template_parm_list ()
...
@@ -683,7 +659,7 @@ begin_template_parm_list ()
invalid to declare a specialization here, an error is reported. */
invalid to declare a specialization here, an error is reported. */
static
void
static
void
check_specialization_scope
()
check_specialization_scope
(
void
)
{
{
tree
scope
=
current_scope
();
tree
scope
=
current_scope
();
...
@@ -715,7 +691,7 @@ check_specialization_scope ()
...
@@ -715,7 +691,7 @@ check_specialization_scope ()
/* We've just seen template <>. */
/* We've just seen template <>. */
void
void
begin_specialization
()
begin_specialization
(
void
)
{
{
begin_scope
(
sk_template_spec
);
begin_scope
(
sk_template_spec
);
note_template_header
(
1
);
note_template_header
(
1
);
...
@@ -726,7 +702,7 @@ begin_specialization ()
...
@@ -726,7 +702,7 @@ begin_specialization ()
template<>. */
template<>. */
void
void
end_specialization
()
end_specialization
(
void
)
{
{
finish_scope
();
finish_scope
();
reset_specialization
();
reset_specialization
();
...
@@ -736,7 +712,7 @@ end_specialization ()
...
@@ -736,7 +712,7 @@ end_specialization ()
function specialization. */
function specialization. */
void
void
reset_specialization
()
reset_specialization
(
void
)
{
{
processing_specialization
=
0
;
processing_specialization
=
0
;
template_header_count
=
0
;
template_header_count
=
0
;
...
@@ -746,8 +722,7 @@ reset_specialization ()
...
@@ -746,8 +722,7 @@ reset_specialization ()
it was of the form template <>. */
it was of the form template <>. */
static
void
static
void
note_template_header
(
specialization
)
note_template_header
(
int
specialization
)
int
specialization
;
{
{
processing_specialization
=
specialization
;
processing_specialization
=
specialization
;
template_header_count
++
;
template_header_count
++
;
...
@@ -756,7 +731,7 @@ note_template_header (specialization)
...
@@ -756,7 +731,7 @@ note_template_header (specialization)
/* We're beginning an explicit instantiation. */
/* We're beginning an explicit instantiation. */
void
void
begin_explicit_instantiation
()
begin_explicit_instantiation
(
void
)
{
{
my_friendly_assert
(
!
processing_explicit_instantiation
,
20020913
);
my_friendly_assert
(
!
processing_explicit_instantiation
,
20020913
);
processing_explicit_instantiation
=
true
;
processing_explicit_instantiation
=
true
;
...
@@ -764,7 +739,7 @@ begin_explicit_instantiation ()
...
@@ -764,7 +739,7 @@ begin_explicit_instantiation ()
void
void
end_explicit_instantiation
()
end_explicit_instantiation
(
void
)
{
{
my_friendly_assert
(
processing_explicit_instantiation
,
20020913
);
my_friendly_assert
(
processing_explicit_instantiation
,
20020913
);
processing_explicit_instantiation
=
false
;
processing_explicit_instantiation
=
false
;
...
@@ -774,8 +749,7 @@ end_explicit_instantiation ()
...
@@ -774,8 +749,7 @@ end_explicit_instantiation ()
is a partial specialization. Do appropriate error-checking. */
is a partial specialization. Do appropriate error-checking. */
void
void
maybe_process_partial_specialization
(
type
)
maybe_process_partial_specialization
(
tree
type
)
tree
type
;
{
{
/* TYPE maybe an ERROR_MARK_NODE. */
/* TYPE maybe an ERROR_MARK_NODE. */
tree
context
=
TYPE_P
(
type
)
?
TYPE_CONTEXT
(
type
)
:
NULL_TREE
;
tree
context
=
TYPE_P
(
type
)
?
TYPE_CONTEXT
(
type
)
:
NULL_TREE
;
...
@@ -878,9 +852,7 @@ maybe_process_partial_specialization (type)
...
@@ -878,9 +852,7 @@ maybe_process_partial_specialization (type)
templates with more than one level of parameters. */
templates with more than one level of parameters. */
static
tree
static
tree
retrieve_specialization
(
tmpl
,
args
)
retrieve_specialization
(
tree
tmpl
,
tree
args
)
tree
tmpl
;
tree
args
;
{
{
tree
s
;
tree
s
;
...
@@ -904,8 +876,7 @@ retrieve_specialization (tmpl, args)
...
@@ -904,8 +876,7 @@ retrieve_specialization (tmpl, args)
/* Like retrieve_specialization, but for local declarations. */
/* Like retrieve_specialization, but for local declarations. */
static
tree
static
tree
retrieve_local_specialization
(
tmpl
)
retrieve_local_specialization
(
tree
tmpl
)
tree
tmpl
;
{
{
tree
spec
=
tree
spec
=
(
tree
)
htab_find_with_hash
(
local_specializations
,
tmpl
,
(
tree
)
htab_find_with_hash
(
local_specializations
,
tmpl
,
...
@@ -916,9 +887,7 @@ retrieve_local_specialization (tmpl)
...
@@ -916,9 +887,7 @@ retrieve_local_specialization (tmpl)
/* Returns nonzero iff DECL is a specialization of TMPL. */
/* Returns nonzero iff DECL is a specialization of TMPL. */
int
int
is_specialization_of
(
decl
,
tmpl
)
is_specialization_of
(
tree
decl
,
tree
tmpl
)
tree
decl
;
tree
tmpl
;
{
{
tree
t
;
tree
t
;
...
@@ -950,10 +919,7 @@ is_specialization_of (decl, tmpl)
...
@@ -950,10 +919,7 @@ is_specialization_of (decl, tmpl)
declaration, if available. */
declaration, if available. */
static
tree
static
tree
register_specialization
(
spec
,
tmpl
,
args
)
register_specialization
(
tree
spec
,
tree
tmpl
,
tree
args
)
tree
spec
;
tree
tmpl
;
tree
args
;
{
{
tree
s
;
tree
s
;
...
@@ -1063,9 +1029,7 @@ register_specialization (spec, tmpl, args)
...
@@ -1063,9 +1029,7 @@ register_specialization (spec, tmpl, args)
TMPL. */
TMPL. */
static
int
static
int
unregister_specialization
(
spec
,
tmpl
)
unregister_specialization
(
tree
spec
,
tree
tmpl
)
tree
spec
;
tree
tmpl
;
{
{
tree
*
s
;
tree
*
s
;
...
@@ -1103,9 +1067,7 @@ hash_local_specialization (const void* p1)
...
@@ -1103,9 +1067,7 @@ hash_local_specialization (const void* p1)
registering SPEC, an instantiation of TMPL. */
registering SPEC, an instantiation of TMPL. */
static
void
static
void
register_local_specialization
(
spec
,
tmpl
)
register_local_specialization
(
tree
spec
,
tree
tmpl
)
tree
spec
;
tree
tmpl
;
{
{
void
**
slot
;
void
**
slot
;
...
@@ -1117,8 +1079,7 @@ register_local_specialization (spec, tmpl)
...
@@ -1117,8 +1079,7 @@ register_local_specialization (spec, tmpl)
/* Print the list of candidate FNS in an error message. */
/* Print the list of candidate FNS in an error message. */
void
void
print_candidates
(
fns
)
print_candidates
(
tree
fns
)
tree
fns
;
{
{
tree
fn
;
tree
fn
;
...
@@ -1150,12 +1111,10 @@ print_candidates (fns)
...
@@ -1150,12 +1111,10 @@ print_candidates (fns)
issued. The error_mark_node is returned to indicate failure. */
issued. The error_mark_node is returned to indicate failure. */
static
tree
static
tree
determine_specialization
(
template_id
,
decl
,
targs_out
,
determine_specialization
(
tree
template_id
,
need_member_template
)
tree
decl
,
tree
template_id
;
tree
*
targs_out
,
tree
decl
;
int
need_member_template
)
tree
*
targs_out
;
int
need_member_template
;
{
{
tree
fns
;
tree
fns
;
tree
targs
;
tree
targs
;
...
@@ -1362,10 +1321,8 @@ determine_specialization (template_id, decl, targs_out,
...
@@ -1362,10 +1321,8 @@ determine_specialization (template_id, decl, targs_out,
TMPL_TYPES. */
TMPL_TYPES. */
static
tree
static
tree
copy_default_args_to_explicit_spec_1
(
spec_types
,
copy_default_args_to_explicit_spec_1
(
tree
spec_types
,
tmpl_types
)
tree
tmpl_types
)
tree
spec_types
;
tree
tmpl_types
;
{
{
tree
new_spec_types
;
tree
new_spec_types
;
...
@@ -1398,8 +1355,7 @@ copy_default_args_to_explicit_spec_1 (spec_types,
...
@@ -1398,8 +1355,7 @@ copy_default_args_to_explicit_spec_1 (spec_types,
is consistent with how implicit instantiations are handled. */
is consistent with how implicit instantiations are handled. */
static
void
static
void
copy_default_args_to_explicit_spec
(
decl
)
copy_default_args_to_explicit_spec
(
tree
decl
)
tree
decl
;
{
{
tree
tmpl
;
tree
tmpl
;
tree
spec_types
;
tree
spec_types
;
...
@@ -1516,11 +1472,10 @@ copy_default_args_to_explicit_spec (decl)
...
@@ -1516,11 +1472,10 @@ copy_default_args_to_explicit_spec (decl)
for that template. */
for that template. */
tree
tree
check_explicit_specialization
(
declarator
,
decl
,
template_count
,
flags
)
check_explicit_specialization
(
tree
declarator
,
tree
declarator
;
tree
decl
,
tree
decl
;
int
template_count
,
int
template_count
;
int
flags
)
int
flags
;
{
{
int
have_def
=
flags
&
2
;
int
have_def
=
flags
&
2
;
int
is_friend
=
flags
&
4
;
int
is_friend
=
flags
&
4
;
...
@@ -1912,8 +1867,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
...
@@ -1912,8 +1867,7 @@ check_explicit_specialization (declarator, decl, template_count, flags)
and such is reasonable. Issue error messages if not. */
and such is reasonable. Issue error messages if not. */
void
void
maybe_check_template_type
(
type
)
maybe_check_template_type
(
tree
type
)
tree
type
;
{
{
if
(
template_header_count
)
if
(
template_header_count
)
{
{
...
@@ -1956,9 +1910,7 @@ maybe_check_template_type (type)
...
@@ -1956,9 +1910,7 @@ maybe_check_template_type (type)
parameters. These are represented in the same format used for
parameters. These are represented in the same format used for
DECL_TEMPLATE_PARMS. */
DECL_TEMPLATE_PARMS. */
int
comp_template_parms
(
parms1
,
parms2
)
int
comp_template_parms
(
tree
parms1
,
tree
parms2
)
tree
parms1
;
tree
parms2
;
{
{
tree
p1
;
tree
p1
;
tree
p2
;
tree
p2
;
...
@@ -2009,8 +1961,7 @@ int comp_template_parms (parms1, parms2)
...
@@ -2009,8 +1961,7 @@ int comp_template_parms (parms1, parms2)
scope (including nested scopes). */
scope (including nested scopes). */
void
void
check_template_shadow
(
decl
)
check_template_shadow
(
tree
decl
)
tree
decl
;
{
{
tree
olddecl
;
tree
olddecl
;
...
@@ -2051,12 +2002,11 @@ check_template_shadow (decl)
...
@@ -2051,12 +2002,11 @@ check_template_shadow (decl)
ORIG_LEVEL, DECL, and TYPE. */
ORIG_LEVEL, DECL, and TYPE. */
static
tree
static
tree
build_template_parm_index
(
index
,
level
,
orig_level
,
decl
,
type
)
build_template_parm_index
(
int
index
,
int
index
;
int
level
,
int
level
;
int
orig_level
,
int
orig_level
;
tree
decl
,
tree
decl
;
tree
type
)
tree
type
;
{
{
tree
t
=
make_node
(
TEMPLATE_PARM_INDEX
);
tree
t
=
make_node
(
TEMPLATE_PARM_INDEX
);
TEMPLATE_PARM_IDX
(
t
)
=
index
;
TEMPLATE_PARM_IDX
(
t
)
=
index
;
...
@@ -2076,10 +2026,7 @@ build_template_parm_index (index, level, orig_level, decl, type)
...
@@ -2076,10 +2026,7 @@ build_template_parm_index (index, level, orig_level, decl, type)
new one is created. */
new one is created. */
static
tree
static
tree
reduce_template_parm_level
(
index
,
type
,
levels
)
reduce_template_parm_level
(
tree
index
,
tree
type
,
int
levels
)
tree
index
;
tree
type
;
int
levels
;
{
{
if
(
TEMPLATE_PARM_DESCENDANTS
(
index
)
==
NULL_TREE
if
(
TEMPLATE_PARM_DESCENDANTS
(
index
)
==
NULL_TREE
||
(
TEMPLATE_PARM_LEVEL
(
TEMPLATE_PARM_DESCENDANTS
(
index
))
||
(
TEMPLATE_PARM_LEVEL
(
TEMPLATE_PARM_DESCENDANTS
(
index
))
...
@@ -2112,8 +2059,7 @@ reduce_template_parm_level (index, type, levels)
...
@@ -2112,8 +2059,7 @@ reduce_template_parm_level (index, type, levels)
LIST being built. */
LIST being built. */
tree
tree
process_template_parm
(
list
,
next
)
process_template_parm
(
tree
list
,
tree
next
)
tree
list
,
next
;
{
{
tree
parm
;
tree
parm
;
tree
decl
=
0
;
tree
decl
=
0
;
...
@@ -2206,8 +2152,7 @@ process_template_parm (list, next)
...
@@ -2206,8 +2152,7 @@ process_template_parm (list, next)
as PARM_DECLs. */
as PARM_DECLs. */
tree
tree
end_template_parm_list
(
parms
)
end_template_parm_list
(
tree
parms
)
tree
parms
;
{
{
int
nparms
;
int
nparms
;
tree
parm
,
next
;
tree
parm
,
next
;
...
@@ -2232,7 +2177,7 @@ end_template_parm_list (parms)
...
@@ -2232,7 +2177,7 @@ end_template_parm_list (parms)
/* end_template_decl is called after a template declaration is seen. */
/* end_template_decl is called after a template declaration is seen. */
void
void
end_template_decl
()
end_template_decl
(
void
)
{
{
reset_specialization
();
reset_specialization
();
...
@@ -2250,7 +2195,7 @@ end_template_decl ()
...
@@ -2250,7 +2195,7 @@ end_template_decl ()
The innermost PARMS are given first. */
The innermost PARMS are given first. */
tree
tree
current_template_args
()
current_template_args
(
void
)
{
{
tree
header
;
tree
header
;
tree
args
=
NULL_TREE
;
tree
args
=
NULL_TREE
;
...
@@ -2302,9 +2247,7 @@ current_template_args ()
...
@@ -2302,9 +2247,7 @@ current_template_args ()
template PARMS. Used by push_template_decl below. */
template PARMS. Used by push_template_decl below. */
static
tree
static
tree
build_template_decl
(
decl
,
parms
)
build_template_decl
(
tree
decl
,
tree
parms
)
tree
decl
;
tree
parms
;
{
{
tree
tmpl
=
build_lang_decl
(
TEMPLATE_DECL
,
DECL_NAME
(
decl
),
NULL_TREE
);
tree
tmpl
=
build_lang_decl
(
TEMPLATE_DECL
,
DECL_NAME
(
decl
),
NULL_TREE
);
DECL_TEMPLATE_PARMS
(
tmpl
)
=
parms
;
DECL_TEMPLATE_PARMS
(
tmpl
)
=
parms
;
...
@@ -2352,9 +2295,7 @@ struct template_parm_data
...
@@ -2352,9 +2295,7 @@ struct template_parm_data
appropriately. */
appropriately. */
static
int
static
int
mark_template_parm
(
t
,
data
)
mark_template_parm
(
tree
t
,
void
*
data
)
tree
t
;
void
*
data
;
{
{
int
level
;
int
level
;
int
idx
;
int
idx
;
...
@@ -2385,8 +2326,7 @@ mark_template_parm (t, data)
...
@@ -2385,8 +2326,7 @@ mark_template_parm (t, data)
/* Process the partial specialization DECL. */
/* Process the partial specialization DECL. */
static
tree
static
tree
process_partial_specialization
(
decl
)
process_partial_specialization
(
tree
decl
)
tree
decl
;
{
{
tree
type
=
TREE_TYPE
(
decl
);
tree
type
=
TREE_TYPE
(
decl
);
tree
maintmpl
=
CLASSTYPE_TI_TEMPLATE
(
type
);
tree
maintmpl
=
CLASSTYPE_TI_TEMPLATE
(
type
);
...
@@ -2564,11 +2504,7 @@ process_partial_specialization (decl)
...
@@ -2564,11 +2504,7 @@ process_partial_specialization (decl)
IS_PARTIAL is nonzero if DECL is a partial specialization. */
IS_PARTIAL is nonzero if DECL is a partial specialization. */
static
void
static
void
check_default_tmpl_args
(
decl
,
parms
,
is_primary
,
is_partial
)
check_default_tmpl_args
(
tree
decl
,
tree
parms
,
int
is_primary
,
int
is_partial
)
tree
decl
;
tree
parms
;
int
is_primary
;
int
is_partial
;
{
{
const
char
*
msg
;
const
char
*
msg
;
int
last_level_to_check
;
int
last_level_to_check
;
...
@@ -2711,9 +2647,7 @@ check_default_tmpl_args (decl, parms, is_primary, is_partial)
...
@@ -2711,9 +2647,7 @@ check_default_tmpl_args (decl, parms, is_primary, is_partial)
parameter of that level, return nonzero. */
parameter of that level, return nonzero. */
static
int
static
int
template_parm_this_level_p
(
t
,
data
)
template_parm_this_level_p
(
tree
t
,
void
*
data
)
tree
t
;
void
*
data
;
{
{
int
this_level
=
*
(
int
*
)
data
;
int
this_level
=
*
(
int
*
)
data
;
int
level
;
int
level
;
...
@@ -2733,9 +2667,7 @@ template_parm_this_level_p (t, data)
...
@@ -2733,9 +2667,7 @@ template_parm_this_level_p (t, data)
If IS_FRIEND is nonzero, DECL is a friend declaration. */
If IS_FRIEND is nonzero, DECL is a friend declaration. */
tree
tree
push_template_decl_real
(
decl
,
is_friend
)
push_template_decl_real
(
tree
decl
,
int
is_friend
)
tree
decl
;
int
is_friend
;
{
{
tree
tmpl
;
tree
tmpl
;
tree
args
;
tree
args
;
...
@@ -2980,8 +2912,7 @@ push_template_decl_real (decl, is_friend)
...
@@ -2980,8 +2912,7 @@ push_template_decl_real (decl, is_friend)
}
}
tree
tree
push_template_decl
(
decl
)
push_template_decl
(
tree
decl
)
tree
decl
;
{
{
return
push_template_decl_real
(
decl
,
0
);
return
push_template_decl_real
(
decl
,
0
);
}
}
...
@@ -2993,9 +2924,7 @@ push_template_decl (decl)
...
@@ -2993,9 +2924,7 @@ push_template_decl (decl)
template <class T> struct S {}; */
template <class T> struct S {}; */
void
void
redeclare_class_template
(
type
,
parms
)
redeclare_class_template
(
tree
type
,
tree
parms
)
tree
type
;
tree
parms
;
{
{
tree
tmpl
;
tree
tmpl
;
tree
tmpl_parms
;
tree
tmpl_parms
;
...
@@ -3074,9 +3003,7 @@ redeclare_class_template (type, parms)
...
@@ -3074,9 +3003,7 @@ redeclare_class_template (type, parms)
parameters. */
parameters. */
static
tree
static
tree
convert_nontype_argument
(
type
,
expr
)
convert_nontype_argument
(
tree
type
,
tree
expr
)
tree
type
;
tree
expr
;
{
{
tree
expr_type
=
TREE_TYPE
(
expr
);
tree
expr_type
=
TREE_TYPE
(
expr
);
...
@@ -3430,11 +3357,11 @@ convert_nontype_argument (type, expr)
...
@@ -3430,11 +3357,11 @@ convert_nontype_argument (type, expr)
substitute the TT parameter. */
substitute the TT parameter. */
static
int
static
int
coerce_template_template_parms
(
parm_parms
,
arg_parms
,
complain
,
coerce_template_template_parms
(
tree
parm_parms
,
in_decl
,
outer_args
)
tree
arg_parms
,
tree
parm_parms
,
arg_parms
;
tsubst_flags_t
complain
,
tsubst_flags_t
complain
;
tree
in_decl
,
tree
in_decl
,
outer_args
;
tree
outer_args
)
{
{
int
nparms
,
nargs
,
i
;
int
nparms
,
nargs
,
i
;
tree
parm
,
arg
;
tree
parm
,
arg
;
...
@@ -3508,13 +3435,12 @@ coerce_template_template_parms (parm_parms, arg_parms, complain,
...
@@ -3508,13 +3435,12 @@ coerce_template_template_parms (parm_parms, arg_parms, complain,
the full set of template arguments deduced so far. */
the full set of template arguments deduced so far. */
static
tree
static
tree
convert_template_argument
(
parm
,
arg
,
args
,
complain
,
i
,
in_decl
)
convert_template_argument
(
tree
parm
,
tree
parm
;
tree
arg
,
tree
arg
;
tree
args
,
tree
args
;
tsubst_flags_t
complain
,
tsubst_flags_t
complain
;
int
i
,
int
i
;
tree
in_decl
)
tree
in_decl
;
{
{
tree
val
;
tree
val
;
tree
inner_args
;
tree
inner_args
;
...
@@ -3700,13 +3626,11 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
...
@@ -3700,13 +3626,11 @@ convert_template_argument (parm, arg, args, complain, i, in_decl)
deduction for any unspecified trailing arguments. */
deduction for any unspecified trailing arguments. */
static
tree
static
tree
coerce_template_parms
(
parms
,
args
,
in_decl
,
coerce_template_parms
(
tree
parms
,
complain
,
tree
args
,
require_all_arguments
)
tree
in_decl
,
tree
parms
,
args
;
tsubst_flags_t
complain
,
tree
in_decl
;
int
require_all_arguments
)
tsubst_flags_t
complain
;
int
require_all_arguments
;
{
{
int
nparms
,
nargs
,
i
,
lost
=
0
;
int
nparms
,
nargs
,
i
,
lost
=
0
;
tree
inner_args
;
tree
inner_args
;
...
@@ -3797,8 +3721,7 @@ coerce_template_parms (parms, args, in_decl,
...
@@ -3797,8 +3721,7 @@ coerce_template_parms (parms, args, in_decl,
/* Returns 1 if template args OT and NT are equivalent. */
/* Returns 1 if template args OT and NT are equivalent. */
static
int
static
int
template_args_equal
(
ot
,
nt
)
template_args_equal
(
tree
ot
,
tree
nt
)
tree
ot
,
nt
;
{
{
if
(
nt
==
ot
)
if
(
nt
==
ot
)
return
1
;
return
1
;
...
@@ -3818,8 +3741,7 @@ template_args_equal (ot, nt)
...
@@ -3818,8 +3741,7 @@ template_args_equal (ot, nt)
of template arguments. Returns 0 otherwise. */
of template arguments. Returns 0 otherwise. */
int
int
comp_template_args
(
oldargs
,
newargs
)
comp_template_args
(
tree
oldargs
,
tree
newargs
)
tree
oldargs
,
newargs
;
{
{
int
i
;
int
i
;
...
@@ -3841,9 +3763,7 @@ comp_template_args (oldargs, newargs)
...
@@ -3841,9 +3763,7 @@ comp_template_args (oldargs, newargs)
for the instantiation. */
for the instantiation. */
static
char
*
static
char
*
mangle_class_name_for_template
(
name
,
parms
,
arglist
)
mangle_class_name_for_template
(
const
char
*
name
,
tree
parms
,
tree
arglist
)
const
char
*
name
;
tree
parms
,
arglist
;
{
{
static
struct
obstack
scratch_obstack
;
static
struct
obstack
scratch_obstack
;
static
char
*
scratch_firstobj
;
static
char
*
scratch_firstobj
;
...
@@ -3931,8 +3851,7 @@ mangle_class_name_for_template (name, parms, arglist)
...
@@ -3931,8 +3851,7 @@ mangle_class_name_for_template (name, parms, arglist)
}
}
static
tree
static
tree
classtype_mangled_name
(
t
)
classtype_mangled_name
(
tree
t
)
tree
t
;
{
{
if
(
CLASSTYPE_TEMPLATE_INFO
(
t
)
if
(
CLASSTYPE_TEMPLATE_INFO
(
t
)
/* Specializations have already had their names set up in
/* Specializations have already had their names set up in
...
@@ -3960,8 +3879,7 @@ classtype_mangled_name (t)
...
@@ -3960,8 +3879,7 @@ classtype_mangled_name (t)
}
}
static
void
static
void
add_pending_template
(
d
)
add_pending_template
(
tree
d
)
tree
d
;
{
{
tree
ti
=
(
TYPE_P
(
d
)
tree
ti
=
(
TYPE_P
(
d
)
?
CLASSTYPE_TEMPLATE_INFO
(
d
)
?
CLASSTYPE_TEMPLATE_INFO
(
d
)
...
@@ -4000,8 +3918,7 @@ add_pending_template (d)
...
@@ -4000,8 +3918,7 @@ add_pending_template (d)
documentation for TEMPLATE_ID_EXPR. */
documentation for TEMPLATE_ID_EXPR. */
tree
tree
lookup_template_function
(
fns
,
arglist
)
lookup_template_function
(
tree
fns
,
tree
arglist
)
tree
fns
,
arglist
;
{
{
tree
type
;
tree
type
;
...
@@ -4045,8 +3962,7 @@ lookup_template_function (fns, arglist)
...
@@ -4045,8 +3962,7 @@ lookup_template_function (fns, arglist)
DECL is returned. */
DECL is returned. */
tree
tree
maybe_get_template_decl_from_type_decl
(
decl
)
maybe_get_template_decl_from_type_decl
(
tree
decl
)
tree
decl
;
{
{
return
(
decl
!=
NULL_TREE
return
(
decl
!=
NULL_TREE
&&
TREE_CODE
(
decl
)
==
TYPE_DECL
&&
TREE_CODE
(
decl
)
==
TYPE_DECL
...
@@ -4077,12 +3993,12 @@ maybe_get_template_decl_from_type_decl (decl)
...
@@ -4077,12 +3993,12 @@ maybe_get_template_decl_from_type_decl (decl)
being instantiated. */
being instantiated. */
tree
tree
lookup_template_class
(
d1
,
arglist
,
in_decl
,
context
,
entering_scope
,
complain
)
lookup_template_class
(
tree
d1
,
tree
d1
,
arglist
;
tree
arglist
,
tree
in_decl
;
tree
in_decl
,
tree
context
;
tree
context
,
int
entering_scope
;
int
entering_scope
,
tsubst_flags_t
complain
;
tsubst_flags_t
complain
)
{
{
tree
template
=
NULL_TREE
,
parmlist
;
tree
template
=
NULL_TREE
,
parmlist
;
tree
t
;
tree
t
;
...
@@ -4539,10 +4455,7 @@ struct pair_fn_data
...
@@ -4539,10 +4455,7 @@ struct pair_fn_data
/* Called from for_each_template_parm via walk_tree. */
/* Called from for_each_template_parm via walk_tree. */
static
tree
static
tree
for_each_template_parm_r
(
tp
,
walk_subtrees
,
d
)
for_each_template_parm_r
(
tree
*
tp
,
int
*
walk_subtrees
,
void
*
d
)
tree
*
tp
;
int
*
walk_subtrees
;
void
*
d
;
{
{
tree
t
=
*
tp
;
tree
t
=
*
tp
;
struct
pair_fn_data
*
pfd
=
(
struct
pair_fn_data
*
)
d
;
struct
pair_fn_data
*
pfd
=
(
struct
pair_fn_data
*
)
d
;
...
@@ -4730,11 +4643,7 @@ for_each_template_parm_r (tp, walk_subtrees, d)
...
@@ -4730,11 +4643,7 @@ for_each_template_parm_r (tp, walk_subtrees, d)
considered to be the function which always returns 1. */
considered to be the function which always returns 1. */
static
int
static
int
for_each_template_parm
(
t
,
fn
,
data
,
visited
)
for_each_template_parm
(
tree
t
,
tree_fn_t
fn
,
void
*
data
,
htab_t
visited
)
tree
t
;
tree_fn_t
fn
;
void
*
data
;
htab_t
visited
;
{
{
struct
pair_fn_data
pfd
;
struct
pair_fn_data
pfd
;
int
result
;
int
result
;
...
@@ -4766,8 +4675,7 @@ for_each_template_parm (t, fn, data, visited)
...
@@ -4766,8 +4675,7 @@ for_each_template_parm (t, fn, data, visited)
}
}
int
int
uses_template_parms
(
t
)
uses_template_parms
(
tree
t
)
tree
t
;
{
{
return
for_each_template_parm
(
t
,
0
,
0
,
NULL
);
return
for_each_template_parm
(
t
,
0
,
0
,
NULL
);
}
}
...
@@ -4784,8 +4692,7 @@ static int last_template_error_tick;
...
@@ -4784,8 +4692,7 @@ static int last_template_error_tick;
for diagnostics and to restore it later. */
for diagnostics and to restore it later. */
int
int
push_tinst_level
(
d
)
push_tinst_level
(
tree
d
)
tree
d
;
{
{
tree
new
;
tree
new
;
...
@@ -4824,7 +4731,7 @@ push_tinst_level (d)
...
@@ -4824,7 +4731,7 @@ push_tinst_level (d)
context. */
context. */
void
void
pop_tinst_level
()
pop_tinst_level
(
void
)
{
{
tree
old
=
current_tinst_level
;
tree
old
=
current_tinst_level
;
...
@@ -4844,8 +4751,7 @@ pop_tinst_level ()
...
@@ -4844,8 +4751,7 @@ pop_tinst_level ()
is one step out from LEVEL. */
is one step out from LEVEL. */
static
void
static
void
reopen_tinst_level
(
level
)
reopen_tinst_level
(
tree
level
)
tree
level
;
{
{
tree
t
;
tree
t
;
...
@@ -4861,7 +4767,7 @@ reopen_tinst_level (level)
...
@@ -4861,7 +4767,7 @@ reopen_tinst_level (level)
-falt-external-templates. */
-falt-external-templates. */
tree
tree
tinst_for_decl
()
tinst_for_decl
(
void
)
{
{
tree
p
=
current_tinst_level
;
tree
p
=
current_tinst_level
;
...
@@ -4877,9 +4783,7 @@ tinst_for_decl ()
...
@@ -4877,9 +4783,7 @@ tinst_for_decl ()
Returns an appropriate tsubst'd friend declaration. */
Returns an appropriate tsubst'd friend declaration. */
static
tree
static
tree
tsubst_friend_function
(
decl
,
args
)
tsubst_friend_function
(
tree
decl
,
tree
args
)
tree
decl
;
tree
args
;
{
{
tree
new_friend
;
tree
new_friend
;
location_t
saved_loc
=
input_location
;
location_t
saved_loc
=
input_location
;
...
@@ -5102,9 +5006,7 @@ tsubst_friend_function (decl, args)
...
@@ -5102,9 +5006,7 @@ tsubst_friend_function (decl, args)
failure. */
failure. */
static
tree
static
tree
tsubst_friend_class
(
friend_tmpl
,
args
)
tsubst_friend_class
(
tree
friend_tmpl
,
tree
args
)
tree
friend_tmpl
;
tree
args
;
{
{
tree
friend_type
;
tree
friend_type
;
tree
tmpl
;
tree
tmpl
;
...
@@ -5193,8 +5095,7 @@ tsubst_friend_class (friend_tmpl, args)
...
@@ -5193,8 +5095,7 @@ tsubst_friend_class (friend_tmpl, args)
Otherwise returns one. */
Otherwise returns one. */
static
int
static
int
can_complete_type_without_circularity
(
type
)
can_complete_type_without_circularity
(
tree
type
)
tree
type
;
{
{
if
(
type
==
NULL_TREE
||
type
==
error_mark_node
)
if
(
type
==
NULL_TREE
||
type
==
error_mark_node
)
return
0
;
return
0
;
...
@@ -5209,8 +5110,7 @@ can_complete_type_without_circularity (type)
...
@@ -5209,8 +5110,7 @@ can_complete_type_without_circularity (type)
}
}
tree
tree
instantiate_class_template
(
type
)
instantiate_class_template
(
tree
type
)
tree
type
;
{
{
tree
template
,
args
,
pattern
,
t
,
member
;
tree
template
,
args
,
pattern
,
t
,
member
;
tree
typedecl
;
tree
typedecl
;
...
@@ -5594,8 +5494,7 @@ instantiate_class_template (type)
...
@@ -5594,8 +5494,7 @@ instantiate_class_template (type)
}
}
static
int
static
int
list_eq
(
t1
,
t2
)
list_eq
(
tree
t1
,
tree
t2
)
tree
t1
,
t2
;
{
{
if
(
t1
==
NULL_TREE
)
if
(
t1
==
NULL_TREE
)
return
t2
==
NULL_TREE
;
return
t2
==
NULL_TREE
;
...
@@ -5613,8 +5512,7 @@ list_eq (t1, t2)
...
@@ -5613,8 +5512,7 @@ list_eq (t1, t2)
arguments, fold it like we weren't in the body of a template. */
arguments, fold it like we weren't in the body of a template. */
static
tree
static
tree
maybe_fold_nontype_arg
(
arg
)
maybe_fold_nontype_arg
(
tree
arg
)
tree
arg
;
{
{
if
(
arg
&&
!
TYPE_P
(
arg
)
&&
!
uses_template_parms
(
arg
))
if
(
arg
&&
!
TYPE_P
(
arg
)
&&
!
uses_template_parms
(
arg
))
{
{
...
@@ -5667,10 +5565,7 @@ maybe_fold_nontype_args (tree targs)
...
@@ -5667,10 +5565,7 @@ maybe_fold_nontype_args (tree targs)
/* Substitute ARGS into the vector of template arguments T. */
/* Substitute ARGS into the vector of template arguments T. */
static
tree
static
tree
tsubst_template_arg_vector
(
t
,
args
,
complain
)
tsubst_template_arg_vector
(
tree
t
,
tree
args
,
tsubst_flags_t
complain
)
tree
t
;
tree
args
;
tsubst_flags_t
complain
;
{
{
int
len
=
TREE_VEC_LENGTH
(
t
),
need_new
=
0
,
i
;
int
len
=
TREE_VEC_LENGTH
(
t
),
need_new
=
0
,
i
;
tree
*
elts
=
(
tree
*
)
alloca
(
len
*
sizeof
(
tree
));
tree
*
elts
=
(
tree
*
)
alloca
(
len
*
sizeof
(
tree
));
...
@@ -5713,10 +5608,7 @@ tsubst_template_arg_vector (t, args, complain)
...
@@ -5713,10 +5608,7 @@ tsubst_template_arg_vector (t, args, complain)
result will be `template <int*, double, class V>'. */
result will be `template <int*, double, class V>'. */
static
tree
static
tree
tsubst_template_parms
(
parms
,
args
,
complain
)
tsubst_template_parms
(
tree
parms
,
tree
args
,
tsubst_flags_t
complain
)
tree
parms
;
tree
args
;
tsubst_flags_t
complain
;
{
{
tree
r
=
NULL_TREE
;
tree
r
=
NULL_TREE
;
tree
*
new_parms
;
tree
*
new_parms
;
...
@@ -5760,12 +5652,11 @@ tsubst_template_parms (parms, args, complain)
...
@@ -5760,12 +5652,11 @@ tsubst_template_parms (parms, args, complain)
we are presently tsubst'ing. Return the substituted value. */
we are presently tsubst'ing. Return the substituted value. */
static
tree
static
tree
tsubst_aggr_type
(
t
,
args
,
complain
,
in_decl
,
entering_scope
)
tsubst_aggr_type
(
tree
t
,
tree
t
;
tree
args
,
tree
args
;
tsubst_flags_t
complain
,
tsubst_flags_t
complain
;
tree
in_decl
,
tree
in_decl
;
int
entering_scope
)
int
entering_scope
;
{
{
if
(
t
==
NULL_TREE
)
if
(
t
==
NULL_TREE
)
return
NULL_TREE
;
return
NULL_TREE
;
...
@@ -5826,10 +5717,7 @@ tsubst_aggr_type (t, args, complain, in_decl, entering_scope)
...
@@ -5826,10 +5717,7 @@ tsubst_aggr_type (t, args, complain, in_decl, entering_scope)
FN), which has the indicated TYPE. */
FN), which has the indicated TYPE. */
tree
tree
tsubst_default_argument
(
fn
,
type
,
arg
)
tsubst_default_argument
(
tree
fn
,
tree
type
,
tree
arg
)
tree
fn
;
tree
type
;
tree
arg
;
{
{
/* This default argument came from a template. Instantiate the
/* This default argument came from a template. Instantiate the
default argument here, not in tsubst. In the case of
default argument here, not in tsubst. In the case of
...
@@ -5865,8 +5753,7 @@ tsubst_default_argument (fn, type, arg)
...
@@ -5865,8 +5753,7 @@ tsubst_default_argument (fn, type, arg)
/* Substitute into all the default arguments for FN. */
/* Substitute into all the default arguments for FN. */
static
void
static
void
tsubst_default_arguments
(
fn
)
tsubst_default_arguments
(
tree
fn
)
tree
fn
;
{
{
tree
arg
;
tree
arg
;
tree
tmpl_args
;
tree
tmpl_args
;
...
@@ -5893,11 +5780,7 @@ tsubst_default_arguments (fn)
...
@@ -5893,11 +5780,7 @@ tsubst_default_arguments (fn)
and warning messages under control of COMPLAIN. */
and warning messages under control of COMPLAIN. */
static
tree
static
tree
tsubst_decl
(
t
,
args
,
type
,
complain
)
tsubst_decl
(
tree
t
,
tree
args
,
tree
type
,
tsubst_flags_t
complain
)
tree
t
;
tree
args
;
tree
type
;
tsubst_flags_t
complain
;
{
{
location_t
saved_loc
;
location_t
saved_loc
;
tree
r
=
NULL_TREE
;
tree
r
=
NULL_TREE
;
...
@@ -6379,11 +6262,10 @@ tsubst_decl (t, args, type, complain)
...
@@ -6379,11 +6262,10 @@ tsubst_decl (t, args, type, complain)
/* Substitue into the ARG_TYPES of a function type. */
/* Substitue into the ARG_TYPES of a function type. */
static
tree
static
tree
tsubst_arg_types
(
arg_types
,
args
,
complain
,
in_decl
)
tsubst_arg_types
(
tree
arg_types
,
tree
arg_types
;
tree
args
,
tree
args
;
tsubst_flags_t
complain
,
tsubst_flags_t
complain
;
tree
in_decl
)
tree
in_decl
;
{
{
tree
remaining_arg_types
;
tree
remaining_arg_types
;
tree
type
;
tree
type
;
...
@@ -6440,11 +6322,10 @@ tsubst_arg_types (arg_types, args, complain, in_decl)
...
@@ -6440,11 +6322,10 @@ tsubst_arg_types (arg_types, args, complain, in_decl)
results in an invalid type.] */
results in an invalid type.] */
static
tree
static
tree
tsubst_function_type
(
t
,
args
,
complain
,
in_decl
)
tsubst_function_type
(
tree
t
,
tree
t
;
tree
args
,
tree
args
;
tsubst_flags_t
complain
,
tsubst_flags_t
complain
;
tree
in_decl
)
tree
in_decl
;
{
{
tree
return_type
;
tree
return_type
;
tree
arg_types
;
tree
arg_types
;
...
@@ -6497,11 +6378,10 @@ tsubst_function_type (t, args, complain, in_decl)
...
@@ -6497,11 +6378,10 @@ tsubst_function_type (t, args, complain, in_decl)
/* Substitute into the PARMS of a call-declarator. */
/* Substitute into the PARMS of a call-declarator. */
static
tree
static
tree
tsubst_call_declarator_parms
(
parms
,
args
,
complain
,
in_decl
)
tsubst_call_declarator_parms
(
tree
parms
,
tree
parms
;
tree
args
,
tree
args
;
tsubst_flags_t
complain
,
tsubst_flags_t
complain
;
tree
in_decl
)
tree
in_decl
;
{
{
tree
new_parms
;
tree
new_parms
;
tree
type
;
tree
type
;
...
@@ -6548,10 +6428,7 @@ tsubst_call_declarator_parms (parms, args, complain, in_decl)
...
@@ -6548,10 +6428,7 @@ tsubst_call_declarator_parms (parms, args, complain, in_decl)
for expressions, use tsubst_expr or tsubst_copy. */
for expressions, use tsubst_expr or tsubst_copy. */
static
tree
static
tree
tsubst
(
t
,
args
,
complain
,
in_decl
)
tsubst
(
tree
t
,
tree
args
,
tsubst_flags_t
complain
,
tree
in_decl
)
tree
t
,
args
;
tsubst_flags_t
complain
;
tree
in_decl
;
{
{
tree
type
,
r
;
tree
type
,
r
;
...
@@ -7183,10 +7060,7 @@ tsubst (t, args, complain, in_decl)
...
@@ -7183,10 +7060,7 @@ tsubst (t, args, complain, in_decl)
tsubst_expr. */
tsubst_expr. */
static
tree
static
tree
tsubst_copy
(
t
,
args
,
complain
,
in_decl
)
tsubst_copy
(
tree
t
,
tree
args
,
tsubst_flags_t
complain
,
tree
in_decl
)
tree
t
,
args
;
tsubst_flags_t
complain
;
tree
in_decl
;
{
{
enum
tree_code
code
;
enum
tree_code
code
;
tree
r
;
tree
r
;
...
@@ -7596,10 +7470,7 @@ tsubst_copy (t, args, complain, in_decl)
...
@@ -7596,10 +7470,7 @@ tsubst_copy (t, args, complain, in_decl)
processing. */
processing. */
static
tree
static
tree
tsubst_expr
(
t
,
args
,
complain
,
in_decl
)
tsubst_expr
(
tree
t
,
tree
args
,
tsubst_flags_t
complain
,
tree
in_decl
)
tree
t
,
args
;
tsubst_flags_t
complain
;
tree
in_decl
;
{
{
tree
stmt
,
tmp
;
tree
stmt
,
tmp
;
...
@@ -7923,10 +7794,10 @@ tsubst_expr (t, args, complain, in_decl)
...
@@ -7923,10 +7794,10 @@ tsubst_expr (t, args, complain, in_decl)
analysis. */
analysis. */
static
tree
static
tree
tsubst_copy_and_build
(
t
,
args
,
complain
,
in_decl
)
tsubst_copy_and_build
(
t
ree
t
,
tree
t
,
args
;
tree
args
,
tsubst_flags_t
complain
;
tsubst_flags_t
complain
,
tree
in_decl
;
tree
in_decl
)
{
{
if
(
t
==
NULL_TREE
||
t
==
error_mark_node
)
if
(
t
==
NULL_TREE
||
t
==
error_mark_node
)
return
t
;
return
t
;
...
@@ -8430,9 +8301,7 @@ tsubst_copy_and_build (t, args, complain, in_decl)
...
@@ -8430,9 +8301,7 @@ tsubst_copy_and_build (t, args, complain, in_decl)
Emit an error under control of COMPLAIN, and return TRUE on error. */
Emit an error under control of COMPLAIN, and return TRUE on error. */
static
bool
static
bool
check_instantiated_args
(
tmpl
,
args
,
complain
)
check_instantiated_args
(
tree
tmpl
,
tree
args
,
tsubst_flags_t
complain
)
tree
tmpl
,
args
;
tsubst_flags_t
complain
;
{
{
int
ix
,
len
=
DECL_NTPARMS
(
tmpl
);
int
ix
,
len
=
DECL_NTPARMS
(
tmpl
);
bool
result
=
false
;
bool
result
=
false
;
...
@@ -8489,9 +8358,7 @@ check_instantiated_args (tmpl, args, complain)
...
@@ -8489,9 +8358,7 @@ check_instantiated_args (tmpl, args, complain)
the template arguments in TARG_PTR. */
the template arguments in TARG_PTR. */
tree
tree
instantiate_template
(
tmpl
,
targ_ptr
,
complain
)
instantiate_template
(
tree
tmpl
,
tree
targ_ptr
,
tsubst_flags_t
complain
)
tree
tmpl
,
targ_ptr
;
tsubst_flags_t
complain
;
{
{
tree
fndecl
;
tree
fndecl
;
tree
gen_tmpl
;
tree
gen_tmpl
;
...
@@ -8616,11 +8483,13 @@ instantiate_template (tmpl, targ_ptr, complain)
...
@@ -8616,11 +8483,13 @@ instantiate_template (tmpl, targ_ptr, complain)
partial ordering in [temp.func.order]/6). */
partial ordering in [temp.func.order]/6). */
int
int
fn_type_unification
(
fn
,
explicit_targs
,
targs
,
args
,
return_type
,
fn_type_unification
(
tree
fn
,
strict
,
len
)
tree
explicit_targs
,
tree
fn
,
explicit_targs
,
targs
,
args
,
return_type
;
tree
targs
,
unification_kind_t
strict
;
tree
args
,
int
len
;
tree
return_type
,
unification_kind_t
strict
,
int
len
)
{
{
tree
parms
;
tree
parms
;
tree
fntype
;
tree
fntype
;
...
@@ -8714,10 +8583,9 @@ fn_type_unification (fn, explicit_targs, targs, args, return_type,
...
@@ -8714,10 +8583,9 @@ fn_type_unification (fn, explicit_targs, targs, args, return_type,
initialized with the result of the conversion function. */
initialized with the result of the conversion function. */
static
int
static
int
maybe_adjust_types_for_deduction
(
strict
,
parm
,
arg
)
maybe_adjust_types_for_deduction
(
unification_kind_t
strict
,
unification_kind_t
strict
;
tree
*
parm
,
tree
*
parm
;
tree
*
arg
)
tree
*
arg
;
{
{
int
result
=
0
;
int
result
=
0
;
...
@@ -8821,12 +8689,14 @@ maybe_adjust_types_for_deduction (strict, parm, arg)
...
@@ -8821,12 +8689,14 @@ maybe_adjust_types_for_deduction (strict, parm, arg)
template). */
template). */
static
int
static
int
type_unification_real
(
tparms
,
targs
,
xparms
,
xargs
,
subr
,
type_unification_real
(
tree
tparms
,
strict
,
allow_incomplete
,
xlen
)
tree
targs
,
tree
tparms
,
targs
,
xparms
,
xargs
;
tree
xparms
,
int
subr
;
tree
xargs
,
unification_kind_t
strict
;
int
subr
,
int
allow_incomplete
,
xlen
;
unification_kind_t
strict
,
int
allow_incomplete
,
int
xlen
)
{
{
tree
parm
,
arg
;
tree
parm
,
arg
;
int
i
;
int
i
;
...
@@ -8995,11 +8865,12 @@ type_unification_real (tparms, targs, xparms, xargs, subr,
...
@@ -8995,11 +8865,12 @@ type_unification_real (tparms, targs, xparms, xargs, subr,
succeeds, we go with that. Modifies TARGS and returns 0 on success. */
succeeds, we go with that. Modifies TARGS and returns 0 on success. */
static
int
static
int
resolve_overloaded_unification
(
tparms
,
targs
,
parm
,
arg
,
strict
,
resolve_overloaded_unification
(
tree
tparms
,
sub_strict
)
tree
targs
,
tree
tparms
,
targs
,
parm
,
arg
;
tree
parm
,
unification_kind_t
strict
;
tree
arg
,
int
sub_strict
;
unification_kind_t
strict
,
int
sub_strict
)
{
{
tree
tempargs
=
copy_node
(
targs
);
tree
tempargs
=
copy_node
(
targs
);
int
good
=
0
;
int
good
=
0
;
...
@@ -9091,11 +8962,13 @@ resolve_overloaded_unification (tparms, targs, parm, arg, strict,
...
@@ -9091,11 +8962,13 @@ resolve_overloaded_unification (tparms, targs, parm, arg, strict,
Returns 1 on success. */
Returns 1 on success. */
static
int
static
int
try_one_overload
(
tparms
,
orig_targs
,
targs
,
parm
,
arg
,
strict
,
try_one_overload
(
tree
tparms
,
sub_strict
)
tree
orig_targs
,
tree
tparms
,
orig_targs
,
targs
,
parm
,
arg
;
tree
targs
,
unification_kind_t
strict
;
tree
parm
,
int
sub_strict
;
tree
arg
,
unification_kind_t
strict
,
int
sub_strict
)
{
{
int
nargs
;
int
nargs
;
tree
tempargs
;
tree
tempargs
;
...
@@ -9173,8 +9046,7 @@ try_one_overload (tparms, orig_targs, targs, parm, arg, strict,
...
@@ -9173,8 +9046,7 @@ try_one_overload (tparms, orig_targs, targs, parm, arg, strict,
ARGS contains template arguments from all levels. */
ARGS contains template arguments from all levels. */
static
int
static
int
verify_class_unification
(
targs
,
parms
,
args
)
verify_class_unification
(
tree
targs
,
tree
parms
,
tree
args
)
tree
targs
,
parms
,
args
;
{
{
parms
=
tsubst
(
parms
,
add_outermost_template_args
(
args
,
targs
),
parms
=
tsubst
(
parms
,
add_outermost_template_args
(
args
,
targs
),
tf_none
,
NULL_TREE
);
tf_none
,
NULL_TREE
);
...
@@ -9190,11 +9062,7 @@ verify_class_unification (targs, parms, args)
...
@@ -9190,11 +9062,7 @@ verify_class_unification (targs, parms, args)
TARGS are as for unify. */
TARGS are as for unify. */
static
tree
static
tree
try_class_unification
(
tparms
,
targs
,
parm
,
arg
)
try_class_unification
(
tree
tparms
,
tree
targs
,
tree
parm
,
tree
arg
)
tree
tparms
;
tree
targs
;
tree
parm
;
tree
arg
;
{
{
tree
copy_of_targs
;
tree
copy_of_targs
;
...
@@ -9247,14 +9115,12 @@ try_class_unification (tparms, targs, parm, arg)
...
@@ -9247,14 +9115,12 @@ try_class_unification (tparms, targs, parm, arg)
for the base class of ARG that we are currently examining. */
for the base class of ARG that we are currently examining. */
static
tree
static
tree
get_template_base_recursive
(
tparms
,
targs
,
parm
,
get_template_base_recursive
(
tree
tparms
,
arg_binfo
,
rval
,
flags
)
tree
targs
,
tree
tparms
;
tree
parm
,
tree
targs
;
tree
arg_binfo
,
tree
arg_binfo
;
tree
rval
,
tree
rval
;
int
flags
)
tree
parm
;
int
flags
;
{
{
tree
binfos
;
tree
binfos
;
int
i
,
n_baselinks
;
int
i
,
n_baselinks
;
...
@@ -9323,11 +9189,7 @@ get_template_base_recursive (tparms, targs, parm,
...
@@ -9323,11 +9189,7 @@ get_template_base_recursive (tparms, targs, parm,
as well as a plain template type. Used by unify. */
as well as a plain template type. Used by unify. */
static
tree
static
tree
get_template_base
(
tparms
,
targs
,
parm
,
arg
)
get_template_base
(
tree
tparms
,
tree
targs
,
tree
parm
,
tree
arg
)
tree
tparms
;
tree
targs
;
tree
parm
;
tree
arg
;
{
{
tree
rval
;
tree
rval
;
tree
arg_binfo
;
tree
arg_binfo
;
...
@@ -9350,8 +9212,7 @@ get_template_base (tparms, targs, parm, arg)
...
@@ -9350,8 +9212,7 @@ get_template_base (tparms, targs, parm, arg)
/* Returns the level of DECL, which declares a template parameter. */
/* Returns the level of DECL, which declares a template parameter. */
static
int
static
int
template_decl_level
(
decl
)
template_decl_level
(
tree
decl
)
tree
decl
;
{
{
switch
(
TREE_CODE
(
decl
))
switch
(
TREE_CODE
(
decl
))
{
{
...
@@ -9373,10 +9234,7 @@ template_decl_level (decl)
...
@@ -9373,10 +9234,7 @@ template_decl_level (decl)
Returns nonzero iff the unification is OK on that basis.*/
Returns nonzero iff the unification is OK on that basis.*/
static
int
static
int
check_cv_quals_for_unify
(
strict
,
arg
,
parm
)
check_cv_quals_for_unify
(
int
strict
,
tree
arg
,
tree
parm
)
int
strict
;
tree
arg
;
tree
parm
;
{
{
int
arg_quals
=
cp_type_quals
(
arg
);
int
arg_quals
=
cp_type_quals
(
arg
);
int
parm_quals
=
cp_type_quals
(
parm
);
int
parm_quals
=
cp_type_quals
(
parm
);
...
@@ -9443,9 +9301,7 @@ check_cv_quals_for_unify (strict, arg, parm)
...
@@ -9443,9 +9301,7 @@ check_cv_quals_for_unify (strict, arg, parm)
folding PARM. */
folding PARM. */
static
int
static
int
unify
(
tparms
,
targs
,
parm
,
arg
,
strict
)
unify
(
tree
tparms
,
tree
targs
,
tree
parm
,
tree
arg
,
int
strict
)
tree
tparms
,
targs
,
parm
,
arg
;
int
strict
;
{
{
int
idx
;
int
idx
;
tree
targ
;
tree
targ
;
...
@@ -9944,9 +9800,7 @@ unify (tparms, targs, parm, arg, strict)
...
@@ -9944,9 +9800,7 @@ unify (tparms, targs, parm, arg, strict)
instantiation of RESULT has been assigned to this file. */
instantiation of RESULT has been assigned to this file. */
void
void
mark_decl_instantiated
(
result
,
extern_p
)
mark_decl_instantiated
(
tree
result
,
int
extern_p
)
tree
result
;
int
extern_p
;
{
{
/* We used to set this unconditionally; we moved that to
/* We used to set this unconditionally; we moved that to
do_decl_instantiation so it wouldn't get set on members of
do_decl_instantiation so it wouldn't get set on members of
...
@@ -9998,10 +9852,7 @@ mark_decl_instantiated (result, extern_p)
...
@@ -9998,10 +9852,7 @@ mark_decl_instantiated (result, extern_p)
LEN is passed through to fn_type_unification. */
LEN is passed through to fn_type_unification. */
int
int
more_specialized
(
pat1
,
pat2
,
deduce
,
len
)
more_specialized
(
tree
pat1
,
tree
pat2
,
int
deduce
,
int
len
)
tree
pat1
,
pat2
;
int
deduce
;
int
len
;
{
{
tree
targs
;
tree
targs
;
int
winner
=
0
;
int
winner
=
0
;
...
@@ -10026,8 +9877,7 @@ more_specialized (pat1, pat2, deduce, len)
...
@@ -10026,8 +9877,7 @@ more_specialized (pat1, pat2, deduce, len)
0 if neither is more specialized. */
0 if neither is more specialized. */
int
int
more_specialized_class
(
pat1
,
pat2
)
more_specialized_class
(
tree
pat1
,
tree
pat2
)
tree
pat1
,
pat2
;
{
{
tree
targs
;
tree
targs
;
int
winner
=
0
;
int
winner
=
0
;
...
@@ -10052,9 +9902,12 @@ more_specialized_class (pat1, pat2)
...
@@ -10052,9 +9902,12 @@ more_specialized_class (pat1, pat2)
found. DEDUCE and LEN are passed through to fn_type_unification. */
found. DEDUCE and LEN are passed through to fn_type_unification. */
static
tree
static
tree
get_bindings_real
(
fn
,
decl
,
explicit_args
,
check_rettype
,
deduce
,
len
)
get_bindings_real
(
tree
fn
,
tree
fn
,
decl
,
explicit_args
;
tree
decl
,
int
check_rettype
,
deduce
,
len
;
tree
explicit_args
,
int
check_rettype
,
int
deduce
,
int
len
)
{
{
int
ntparms
=
DECL_NTPARMS
(
fn
);
int
ntparms
=
DECL_NTPARMS
(
fn
);
tree
targs
=
make_tree_vec
(
ntparms
);
tree
targs
=
make_tree_vec
(
ntparms
);
...
@@ -10109,8 +9962,7 @@ get_bindings_real (fn, decl, explicit_args, check_rettype, deduce, len)
...
@@ -10109,8 +9962,7 @@ get_bindings_real (fn, decl, explicit_args, check_rettype, deduce, len)
/* For most uses, we want to check the return type. */
/* For most uses, we want to check the return type. */
tree
tree
get_bindings
(
fn
,
decl
,
explicit_args
)
get_bindings
(
tree
fn
,
tree
decl
,
tree
explicit_args
)
tree
fn
,
decl
,
explicit_args
;
{
{
return
get_bindings_real
(
fn
,
decl
,
explicit_args
,
1
,
DEDUCE_EXACT
,
-
1
);
return
get_bindings_real
(
fn
,
decl
,
explicit_args
,
1
,
DEDUCE_EXACT
,
-
1
);
}
}
...
@@ -10119,8 +9971,7 @@ get_bindings (fn, decl, explicit_args)
...
@@ -10119,8 +9971,7 @@ get_bindings (fn, decl, explicit_args)
types. */
types. */
static
tree
static
tree
get_bindings_overload
(
fn
,
decl
,
explicit_args
)
get_bindings_overload
(
tree
fn
,
tree
decl
,
tree
explicit_args
)
tree
fn
,
decl
,
explicit_args
;
{
{
return
get_bindings_real
(
fn
,
decl
,
explicit_args
,
0
,
DEDUCE_EXACT
,
-
1
);
return
get_bindings_real
(
fn
,
decl
,
explicit_args
,
0
,
DEDUCE_EXACT
,
-
1
);
}
}
...
@@ -10141,8 +9992,7 @@ get_bindings_overload (fn, decl, explicit_args)
...
@@ -10141,8 +9992,7 @@ get_bindings_overload (fn, decl, explicit_args)
is bound to `double'. */
is bound to `double'. */
static
tree
static
tree
get_class_bindings
(
tparms
,
parms
,
args
)
get_class_bindings
(
tree
tparms
,
tree
parms
,
tree
args
)
tree
tparms
,
parms
,
args
;
{
{
int
i
,
ntparms
=
TREE_VEC_LENGTH
(
tparms
);
int
i
,
ntparms
=
TREE_VEC_LENGTH
(
tparms
);
tree
vec
=
make_tree_vec
(
ntparms
);
tree
vec
=
make_tree_vec
(
ntparms
);
...
@@ -10169,8 +10019,7 @@ get_class_bindings (tparms, parms, args)
...
@@ -10169,8 +10019,7 @@ get_class_bindings (tparms, parms, args)
NULL_TREE is returned. */
NULL_TREE is returned. */
tree
tree
most_specialized_instantiation
(
instantiations
)
most_specialized_instantiation
(
tree
instantiations
)
tree
instantiations
;
{
{
tree
fn
,
champ
;
tree
fn
,
champ
;
int
fate
;
int
fate
;
...
@@ -10213,8 +10062,7 @@ most_specialized_instantiation (instantiations)
...
@@ -10213,8 +10062,7 @@ most_specialized_instantiation (instantiations)
arguments EXPLICIT_ARGS. */
arguments EXPLICIT_ARGS. */
static
tree
static
tree
most_specialized
(
fns
,
decl
,
explicit_args
)
most_specialized
(
tree
fns
,
tree
decl
,
tree
explicit_args
)
tree
fns
,
decl
,
explicit_args
;
{
{
tree
candidates
=
NULL_TREE
;
tree
candidates
=
NULL_TREE
;
tree
fn
,
args
;
tree
fn
,
args
;
...
@@ -10248,8 +10096,7 @@ most_specialized (fns, decl, explicit_args)
...
@@ -10248,8 +10096,7 @@ most_specialized (fns, decl, explicit_args)
`template <class T> template <class U> S<T*>::f(U)'. */
`template <class T> template <class U> S<T*>::f(U)'. */
tree
tree
most_general_template
(
decl
)
most_general_template
(
tree
decl
)
tree
decl
;
{
{
/* If DECL is a FUNCTION_DECL, find the TEMPLATE_DECL of which it is
/* If DECL is a FUNCTION_DECL, find the TEMPLATE_DECL of which it is
an immediate specialization. */
an immediate specialization. */
...
@@ -10295,9 +10142,7 @@ most_general_template (decl)
...
@@ -10295,9 +10142,7 @@ most_general_template (decl)
error_mark_node if the choice is ambiguous. */
error_mark_node if the choice is ambiguous. */
static
tree
static
tree
most_specialized_class
(
tmpl
,
args
)
most_specialized_class
(
tree
tmpl
,
tree
args
)
tree
tmpl
;
tree
args
;
{
{
tree
list
=
NULL_TREE
;
tree
list
=
NULL_TREE
;
tree
t
;
tree
t
;
...
@@ -10462,9 +10307,7 @@ do_decl_instantiation (tree decl, tree storage)
...
@@ -10462,9 +10307,7 @@ do_decl_instantiation (tree decl, tree storage)
}
}
void
void
mark_class_instantiated
(
t
,
extern_p
)
mark_class_instantiated
(
tree
t
,
int
extern_p
)
tree
t
;
int
extern_p
;
{
{
SET_CLASSTYPE_EXPLICIT_INSTANTIATION
(
t
);
SET_CLASSTYPE_EXPLICIT_INSTANTIATION
(
t
);
SET_CLASSTYPE_INTERFACE_KNOWN
(
t
);
SET_CLASSTYPE_INTERFACE_KNOWN
(
t
);
...
@@ -10495,9 +10338,7 @@ bt_instantiate_type_proc (binding_entry entry, void *data)
...
@@ -10495,9 +10338,7 @@ bt_instantiate_type_proc (binding_entry entry, void *data)
since the standard is unclear (as detailed below). */
since the standard is unclear (as detailed below). */
void
void
do_type_instantiation
(
t
,
storage
,
complain
)
do_type_instantiation
(
tree
t
,
tree
storage
,
tsubst_flags_t
complain
)
tree
t
,
storage
;
tsubst_flags_t
complain
;
{
{
int
extern_p
=
0
;
int
extern_p
=
0
;
int
nomem_p
=
0
;
int
nomem_p
=
0
;
...
@@ -10656,9 +10497,7 @@ do_type_instantiation (t, storage, complain)
...
@@ -10656,9 +10497,7 @@ do_type_instantiation (t, storage, complain)
to instantiate the DECL, we regenerate it. */
to instantiate the DECL, we regenerate it. */
static
void
static
void
regenerate_decl_from_template
(
decl
,
tmpl
)
regenerate_decl_from_template
(
tree
decl
,
tree
tmpl
)
tree
decl
;
tree
tmpl
;
{
{
/* The most general version of TMPL. */
/* The most general version of TMPL. */
tree
gen_tmpl
;
tree
gen_tmpl
;
...
@@ -10791,9 +10630,7 @@ template_for_substitution (tree decl)
...
@@ -10791,9 +10630,7 @@ template_for_substitution (tree decl)
instantiation now; we just have to do it sometime. */
instantiation now; we just have to do it sometime. */
tree
tree
instantiate_decl
(
d
,
defer_ok
)
instantiate_decl
(
tree
d
,
int
defer_ok
)
tree
d
;
int
defer_ok
;
{
{
tree
tmpl
=
DECL_TI_TEMPLATE
(
d
);
tree
tmpl
=
DECL_TI_TEMPLATE
(
d
);
tree
gen_args
;
tree
gen_args
;
...
@@ -11107,7 +10944,7 @@ out:
...
@@ -11107,7 +10944,7 @@ out:
instantiate, and instantiate any we can. */
instantiate, and instantiate any we can. */
int
int
instantiate_pending_templates
()
instantiate_pending_templates
(
void
)
{
{
tree
*
t
;
tree
*
t
;
tree
last
=
NULL_TREE
;
tree
last
=
NULL_TREE
;
...
@@ -11196,8 +11033,7 @@ instantiate_pending_templates ()
...
@@ -11196,8 +11033,7 @@ instantiate_pending_templates ()
instantiate_decl. */
instantiate_decl. */
static
tree
static
tree
tsubst_initializer_list
(
t
,
argvec
)
tsubst_initializer_list
(
tree
t
,
tree
argvec
)
tree
t
,
argvec
;
{
{
tree
inits
=
NULL_TREE
;
tree
inits
=
NULL_TREE
;
...
@@ -11238,8 +11074,7 @@ tsubst_initializer_list (t, argvec)
...
@@ -11238,8 +11074,7 @@ tsubst_initializer_list (t, argvec)
/* Set CURRENT_ACCESS_SPECIFIER based on the protection of DECL. */
/* Set CURRENT_ACCESS_SPECIFIER based on the protection of DECL. */
static
void
static
void
set_current_access_from_decl
(
decl
)
set_current_access_from_decl
(
tree
decl
)
tree
decl
;
{
{
if
(
TREE_PRIVATE
(
decl
))
if
(
TREE_PRIVATE
(
decl
))
current_access_specifier
=
access_private_node
;
current_access_specifier
=
access_private_node
;
...
@@ -11254,10 +11089,7 @@ set_current_access_from_decl (decl)
...
@@ -11254,10 +11089,7 @@ set_current_access_from_decl (decl)
start_enum) and ARGS are the template arguments to use. */
start_enum) and ARGS are the template arguments to use. */
static
void
static
void
tsubst_enum
(
tag
,
newtag
,
args
)
tsubst_enum
(
tree
tag
,
tree
newtag
,
tree
args
)
tree
tag
;
tree
newtag
;
tree
args
;
{
{
tree
e
;
tree
e
;
...
@@ -11289,8 +11121,7 @@ tsubst_enum (tag, newtag, args)
...
@@ -11289,8 +11121,7 @@ tsubst_enum (tag, newtag, args)
the type. */
the type. */
tree
tree
get_mostly_instantiated_function_type
(
decl
)
get_mostly_instantiated_function_type
(
tree
decl
)
tree
decl
;
{
{
tree
fn_type
;
tree
fn_type
;
tree
tmpl
;
tree
tmpl
;
...
@@ -11354,20 +11185,20 @@ get_mostly_instantiated_function_type (decl)
...
@@ -11354,20 +11185,20 @@ get_mostly_instantiated_function_type (decl)
/* Return truthvalue if we're processing a template different from
/* Return truthvalue if we're processing a template different from
the last one involved in diagnostics. */
the last one involved in diagnostics. */
int
int
problematic_instantiation_changed
()
problematic_instantiation_changed
(
void
)
{
{
return
last_template_error_tick
!=
tinst_level_tick
;
return
last_template_error_tick
!=
tinst_level_tick
;
}
}
/* Remember current template involved in diagnostics. */
/* Remember current template involved in diagnostics. */
void
void
record_last_problematic_instantiation
()
record_last_problematic_instantiation
(
void
)
{
{
last_template_error_tick
=
tinst_level_tick
;
last_template_error_tick
=
tinst_level_tick
;
}
}
tree
tree
current_instantiation
()
current_instantiation
(
void
)
{
{
return
current_tinst_level
;
return
current_tinst_level
;
}
}
...
@@ -11377,9 +11208,7 @@ current_instantiation ()
...
@@ -11377,9 +11208,7 @@ current_instantiation ()
warning messages under control of COMPLAIN. */
warning messages under control of COMPLAIN. */
static
int
static
int
invalid_nontype_parm_type_p
(
type
,
complain
)
invalid_nontype_parm_type_p
(
tree
type
,
tsubst_flags_t
complain
)
tree
type
;
tsubst_flags_t
complain
;
{
{
if
(
INTEGRAL_TYPE_P
(
type
))
if
(
INTEGRAL_TYPE_P
(
type
))
return
0
;
return
0
;
...
@@ -11610,8 +11439,7 @@ value_dependent_expression_p (tree expression)
...
@@ -11610,8 +11439,7 @@ value_dependent_expression_p (tree expression)
[temp.dep.expr]. */
[temp.dep.expr]. */
bool
bool
type_dependent_expression_p
(
expression
)
type_dependent_expression_p
(
tree
expression
)
tree
expression
;
{
{
if
(
!
processing_template_decl
)
if
(
!
processing_template_decl
)
return
false
;
return
false
;
...
...
gcc/cp/semantics.c
View file @
3a978d72
...
@@ -51,16 +51,16 @@
...
@@ -51,16 +51,16 @@
parsing into this file; that will make implementing the new parser
parsing into this file; that will make implementing the new parser
much easier since it will be able to make use of these routines. */
much easier since it will be able to make use of these routines. */
static
tree
maybe_convert_cond
PARAMS
((
tree
)
);
static
tree
maybe_convert_cond
(
tree
);
static
tree
simplify_aggr_init_exprs_r
PARAMS
((
tree
*
,
int
*
,
void
*
)
);
static
tree
simplify_aggr_init_exprs_r
(
tree
*
,
int
*
,
void
*
);
static
void
emit_associated_thunks
PARAMS
((
tree
)
);
static
void
emit_associated_thunks
(
tree
);
static
void
genrtl_try_block
PARAMS
((
tree
)
);
static
void
genrtl_try_block
(
tree
);
static
void
genrtl_eh_spec_block
PARAMS
((
tree
)
);
static
void
genrtl_eh_spec_block
(
tree
);
static
void
genrtl_handler
PARAMS
((
tree
)
);
static
void
genrtl_handler
(
tree
);
static
void
cp_expand_stmt
PARAMS
((
tree
)
);
static
void
cp_expand_stmt
(
tree
);
static
void
genrtl_start_function
PARAMS
((
tree
)
);
static
void
genrtl_start_function
(
tree
);
static
void
genrtl_finish_function
PARAMS
((
tree
)
);
static
void
genrtl_finish_function
(
tree
);
static
tree
clear_decl_rtl
PARAMS
((
tree
*
,
int
*
,
void
*
)
);
static
tree
clear_decl_rtl
(
tree
*
,
int
*
,
void
*
);
/* Finish processing the COND, the SUBSTMT condition for STMT. */
/* Finish processing the COND, the SUBSTMT condition for STMT. */
...
@@ -297,7 +297,7 @@ void perform_or_defer_access_check (tree class_type, tree decl)
...
@@ -297,7 +297,7 @@ void perform_or_defer_access_check (tree class_type, tree decl)
at the end of the statement. */
at the end of the statement. */
int
int
stmts_are_full_exprs_p
()
stmts_are_full_exprs_p
(
void
)
{
{
return
current_stmt_tree
()
->
stmts_are_full_exprs_p
;
return
current_stmt_tree
()
->
stmts_are_full_exprs_p
;
}
}
...
@@ -307,7 +307,7 @@ stmts_are_full_exprs_p ()
...
@@ -307,7 +307,7 @@ stmts_are_full_exprs_p ()
returned. */
returned. */
stmt_tree
stmt_tree
current_stmt_tree
()
current_stmt_tree
(
void
)
{
{
return
(
cfun
return
(
cfun
?
&
cfun
->
language
->
base
.
x_stmt_tree
?
&
cfun
->
language
->
base
.
x_stmt_tree
...
@@ -319,8 +319,7 @@ current_stmt_tree ()
...
@@ -319,8 +319,7 @@ current_stmt_tree ()
declared is not an anonymous union" [class.union]. */
declared is not an anonymous union" [class.union]. */
int
int
anon_aggr_type_p
(
node
)
anon_aggr_type_p
(
tree
node
)
tree
node
;
{
{
return
ANON_AGGR_TYPE_P
(
node
);
return
ANON_AGGR_TYPE_P
(
node
);
}
}
...
@@ -328,7 +327,7 @@ anon_aggr_type_p (node)
...
@@ -328,7 +327,7 @@ anon_aggr_type_p (node)
/* Finish a scope. */
/* Finish a scope. */
tree
tree
do_poplevel
()
do_poplevel
(
void
)
{
{
tree
block
=
NULL_TREE
;
tree
block
=
NULL_TREE
;
...
@@ -369,8 +368,7 @@ do_pushlevel (scope_kind sk)
...
@@ -369,8 +368,7 @@ do_pushlevel (scope_kind sk)
/* Finish a goto-statement. */
/* Finish a goto-statement. */
tree
tree
finish_goto_stmt
(
destination
)
finish_goto_stmt
(
tree
destination
)
tree
destination
;
{
{
if
(
TREE_CODE
(
destination
)
==
IDENTIFIER_NODE
)
if
(
TREE_CODE
(
destination
)
==
IDENTIFIER_NODE
)
destination
=
lookup_label
(
destination
);
destination
=
lookup_label
(
destination
);
...
@@ -396,8 +394,7 @@ finish_goto_stmt (destination)
...
@@ -396,8 +394,7 @@ finish_goto_stmt (destination)
statement. Convert it to a boolean value, if appropriate. */
statement. Convert it to a boolean value, if appropriate. */
tree
tree
maybe_convert_cond
(
cond
)
maybe_convert_cond
(
tree
cond
)
tree
cond
;
{
{
/* Empty conditions remain empty. */
/* Empty conditions remain empty. */
if
(
!
cond
)
if
(
!
cond
)
...
@@ -415,8 +412,7 @@ maybe_convert_cond (cond)
...
@@ -415,8 +412,7 @@ maybe_convert_cond (cond)
/* Finish an expression-statement, whose EXPRESSION is as indicated. */
/* Finish an expression-statement, whose EXPRESSION is as indicated. */
tree
tree
finish_expr_stmt
(
expr
)
finish_expr_stmt
(
tree
expr
)
tree
expr
;
{
{
tree
r
=
NULL_TREE
;
tree
r
=
NULL_TREE
;
tree
expr_type
=
NULL_TREE
;;
tree
expr_type
=
NULL_TREE
;;
...
@@ -453,7 +449,7 @@ finish_expr_stmt (expr)
...
@@ -453,7 +449,7 @@ finish_expr_stmt (expr)
appropriate. */
appropriate. */
tree
tree
begin_if_stmt
()
begin_if_stmt
(
void
)
{
{
tree
r
;
tree
r
;
do_pushlevel
(
sk_block
);
do_pushlevel
(
sk_block
);
...
@@ -466,9 +462,7 @@ begin_if_stmt ()
...
@@ -466,9 +462,7 @@ begin_if_stmt ()
IF_STMT. */
IF_STMT. */
void
void
finish_if_stmt_cond
(
cond
,
if_stmt
)
finish_if_stmt_cond
(
tree
cond
,
tree
if_stmt
)
tree
cond
;
tree
if_stmt
;
{
{
cond
=
maybe_convert_cond
(
cond
);
cond
=
maybe_convert_cond
(
cond
);
FINISH_COND
(
cond
,
if_stmt
,
IF_COND
(
if_stmt
));
FINISH_COND
(
cond
,
if_stmt
,
IF_COND
(
if_stmt
));
...
@@ -478,8 +472,7 @@ finish_if_stmt_cond (cond, if_stmt)
...
@@ -478,8 +472,7 @@ finish_if_stmt_cond (cond, if_stmt)
IF_STMT. */
IF_STMT. */
tree
tree
finish_then_clause
(
if_stmt
)
finish_then_clause
(
tree
if_stmt
)
tree
if_stmt
;
{
{
RECHAIN_STMTS
(
if_stmt
,
THEN_CLAUSE
(
if_stmt
));
RECHAIN_STMTS
(
if_stmt
,
THEN_CLAUSE
(
if_stmt
));
return
if_stmt
;
return
if_stmt
;
...
@@ -488,7 +481,7 @@ finish_then_clause (if_stmt)
...
@@ -488,7 +481,7 @@ finish_then_clause (if_stmt)
/* Begin the else-clause of an if-statement. */
/* Begin the else-clause of an if-statement. */
void
void
begin_else_clause
()
begin_else_clause
(
void
)
{
{
}
}
...
@@ -496,8 +489,7 @@ begin_else_clause ()
...
@@ -496,8 +489,7 @@ begin_else_clause ()
IF_STMT. */
IF_STMT. */
void
void
finish_else_clause
(
if_stmt
)
finish_else_clause
(
tree
if_stmt
)
tree
if_stmt
;
{
{
RECHAIN_STMTS
(
if_stmt
,
ELSE_CLAUSE
(
if_stmt
));
RECHAIN_STMTS
(
if_stmt
,
ELSE_CLAUSE
(
if_stmt
));
}
}
...
@@ -505,7 +497,7 @@ finish_else_clause (if_stmt)
...
@@ -505,7 +497,7 @@ finish_else_clause (if_stmt)
/* Finish an if-statement. */
/* Finish an if-statement. */
void
void
finish_if_stmt
()
finish_if_stmt
(
void
)
{
{
finish_stmt
();
finish_stmt
();
do_poplevel
();
do_poplevel
();
...
@@ -515,7 +507,7 @@ finish_if_stmt ()
...
@@ -515,7 +507,7 @@ finish_if_stmt ()
appropriate. */
appropriate. */
tree
tree
begin_while_stmt
()
begin_while_stmt
(
void
)
{
{
tree
r
;
tree
r
;
r
=
build_stmt
(
WHILE_STMT
,
NULL_TREE
,
NULL_TREE
);
r
=
build_stmt
(
WHILE_STMT
,
NULL_TREE
,
NULL_TREE
);
...
@@ -528,9 +520,7 @@ begin_while_stmt ()
...
@@ -528,9 +520,7 @@ begin_while_stmt ()
WHILE_STMT. */
WHILE_STMT. */
void
void
finish_while_stmt_cond
(
cond
,
while_stmt
)
finish_while_stmt_cond
(
tree
cond
,
tree
while_stmt
)
tree
cond
;
tree
while_stmt
;
{
{
cond
=
maybe_convert_cond
(
cond
);
cond
=
maybe_convert_cond
(
cond
);
if
(
processing_template_decl
)
if
(
processing_template_decl
)
...
@@ -561,8 +551,7 @@ finish_while_stmt_cond (cond, while_stmt)
...
@@ -561,8 +551,7 @@ finish_while_stmt_cond (cond, while_stmt)
/* Finish a while-statement, which may be given by WHILE_STMT. */
/* Finish a while-statement, which may be given by WHILE_STMT. */
void
void
finish_while_stmt
(
while_stmt
)
finish_while_stmt
(
tree
while_stmt
)
tree
while_stmt
;
{
{
do_poplevel
();
do_poplevel
();
RECHAIN_STMTS
(
while_stmt
,
WHILE_BODY
(
while_stmt
));
RECHAIN_STMTS
(
while_stmt
,
WHILE_BODY
(
while_stmt
));
...
@@ -573,7 +562,7 @@ finish_while_stmt (while_stmt)
...
@@ -573,7 +562,7 @@ finish_while_stmt (while_stmt)
appropriate. */
appropriate. */
tree
tree
begin_do_stmt
()
begin_do_stmt
(
void
)
{
{
tree
r
=
build_stmt
(
DO_STMT
,
NULL_TREE
,
NULL_TREE
);
tree
r
=
build_stmt
(
DO_STMT
,
NULL_TREE
,
NULL_TREE
);
add_stmt
(
r
);
add_stmt
(
r
);
...
@@ -583,8 +572,7 @@ begin_do_stmt ()
...
@@ -583,8 +572,7 @@ begin_do_stmt ()
/* Finish the body of a do-statement, which may be given by DO_STMT. */
/* Finish the body of a do-statement, which may be given by DO_STMT. */
void
void
finish_do_body
(
do_stmt
)
finish_do_body
(
tree
do_stmt
)
tree
do_stmt
;
{
{
RECHAIN_STMTS
(
do_stmt
,
DO_BODY
(
do_stmt
));
RECHAIN_STMTS
(
do_stmt
,
DO_BODY
(
do_stmt
));
}
}
...
@@ -593,9 +581,7 @@ finish_do_body (do_stmt)
...
@@ -593,9 +581,7 @@ finish_do_body (do_stmt)
COND is as indicated. */
COND is as indicated. */
void
void
finish_do_stmt
(
cond
,
do_stmt
)
finish_do_stmt
(
tree
cond
,
tree
do_stmt
)
tree
cond
;
tree
do_stmt
;
{
{
cond
=
maybe_convert_cond
(
cond
);
cond
=
maybe_convert_cond
(
cond
);
DO_COND
(
do_stmt
)
=
cond
;
DO_COND
(
do_stmt
)
=
cond
;
...
@@ -606,8 +592,7 @@ finish_do_stmt (cond, do_stmt)
...
@@ -606,8 +592,7 @@ finish_do_stmt (cond, do_stmt)
indicated. */
indicated. */
tree
tree
finish_return_stmt
(
expr
)
finish_return_stmt
(
tree
expr
)
tree
expr
;
{
{
tree
r
;
tree
r
;
...
@@ -632,7 +617,7 @@ finish_return_stmt (expr)
...
@@ -632,7 +617,7 @@ finish_return_stmt (expr)
/* Begin a for-statement. Returns a new FOR_STMT if appropriate. */
/* Begin a for-statement. Returns a new FOR_STMT if appropriate. */
tree
tree
begin_for_stmt
()
begin_for_stmt
(
void
)
{
{
tree
r
;
tree
r
;
...
@@ -650,8 +635,7 @@ begin_for_stmt ()
...
@@ -650,8 +635,7 @@ begin_for_stmt ()
given by FOR_STMT. */
given by FOR_STMT. */
void
void
finish_for_init_stmt
(
for_stmt
)
finish_for_init_stmt
(
tree
for_stmt
)
tree
for_stmt
;
{
{
if
(
last_tree
!=
for_stmt
)
if
(
last_tree
!=
for_stmt
)
RECHAIN_STMTS
(
for_stmt
,
FOR_INIT_STMT
(
for_stmt
));
RECHAIN_STMTS
(
for_stmt
,
FOR_INIT_STMT
(
for_stmt
));
...
@@ -662,9 +646,7 @@ finish_for_init_stmt (for_stmt)
...
@@ -662,9 +646,7 @@ finish_for_init_stmt (for_stmt)
FOR_STMT. */
FOR_STMT. */
void
void
finish_for_cond
(
cond
,
for_stmt
)
finish_for_cond
(
tree
cond
,
tree
for_stmt
)
tree
cond
;
tree
for_stmt
;
{
{
cond
=
maybe_convert_cond
(
cond
);
cond
=
maybe_convert_cond
(
cond
);
if
(
processing_template_decl
)
if
(
processing_template_decl
)
...
@@ -696,9 +678,7 @@ finish_for_cond (cond, for_stmt)
...
@@ -696,9 +678,7 @@ finish_for_cond (cond, for_stmt)
given by FOR_STMT. */
given by FOR_STMT. */
void
void
finish_for_expr
(
expr
,
for_stmt
)
finish_for_expr
(
tree
expr
,
tree
for_stmt
)
tree
expr
;
tree
for_stmt
;
{
{
FOR_EXPR
(
for_stmt
)
=
expr
;
FOR_EXPR
(
for_stmt
)
=
expr
;
}
}
...
@@ -708,8 +688,7 @@ finish_for_expr (expr, for_stmt)
...
@@ -708,8 +688,7 @@ finish_for_expr (expr, for_stmt)
provided. */
provided. */
void
void
finish_for_stmt
(
for_stmt
)
finish_for_stmt
(
tree
for_stmt
)
tree
for_stmt
;
{
{
/* Pop the scope for the body of the loop. */
/* Pop the scope for the body of the loop. */
do_poplevel
();
do_poplevel
();
...
@@ -722,7 +701,7 @@ finish_for_stmt (for_stmt)
...
@@ -722,7 +701,7 @@ finish_for_stmt (for_stmt)
/* Finish a break-statement. */
/* Finish a break-statement. */
tree
tree
finish_break_stmt
()
finish_break_stmt
(
void
)
{
{
return
add_stmt
(
build_break_stmt
());
return
add_stmt
(
build_break_stmt
());
}
}
...
@@ -730,7 +709,7 @@ finish_break_stmt ()
...
@@ -730,7 +709,7 @@ finish_break_stmt ()
/* Finish a continue-statement. */
/* Finish a continue-statement. */
tree
tree
finish_continue_stmt
()
finish_continue_stmt
(
void
)
{
{
return
add_stmt
(
build_continue_stmt
());
return
add_stmt
(
build_continue_stmt
());
}
}
...
@@ -739,7 +718,7 @@ finish_continue_stmt ()
...
@@ -739,7 +718,7 @@ finish_continue_stmt ()
appropriate. */
appropriate. */
tree
tree
begin_switch_stmt
()
begin_switch_stmt
(
void
)
{
{
tree
r
;
tree
r
;
do_pushlevel
(
sk_block
);
do_pushlevel
(
sk_block
);
...
@@ -751,9 +730,7 @@ begin_switch_stmt ()
...
@@ -751,9 +730,7 @@ begin_switch_stmt ()
/* Finish the cond of a switch-statement. */
/* Finish the cond of a switch-statement. */
void
void
finish_switch_cond
(
cond
,
switch_stmt
)
finish_switch_cond
(
tree
cond
,
tree
switch_stmt
)
tree
cond
;
tree
switch_stmt
;
{
{
tree
orig_type
=
NULL
;
tree
orig_type
=
NULL
;
if
(
!
processing_template_decl
)
if
(
!
processing_template_decl
)
...
@@ -795,8 +772,7 @@ finish_switch_cond (cond, switch_stmt)
...
@@ -795,8 +772,7 @@ finish_switch_cond (cond, switch_stmt)
SWITCH_STMT. The COND to switch on is indicated. */
SWITCH_STMT. The COND to switch on is indicated. */
void
void
finish_switch_stmt
(
switch_stmt
)
finish_switch_stmt
(
tree
switch_stmt
)
tree
switch_stmt
;
{
{
RECHAIN_STMTS
(
switch_stmt
,
SWITCH_BODY
(
switch_stmt
));
RECHAIN_STMTS
(
switch_stmt
,
SWITCH_BODY
(
switch_stmt
));
pop_switch
();
pop_switch
();
...
@@ -807,8 +783,7 @@ finish_switch_stmt (switch_stmt)
...
@@ -807,8 +783,7 @@ finish_switch_stmt (switch_stmt)
/* Generate the RTL for T, which is a TRY_BLOCK. */
/* Generate the RTL for T, which is a TRY_BLOCK. */
static
void
static
void
genrtl_try_block
(
t
)
genrtl_try_block
(
tree
t
)
tree
t
;
{
{
if
(
CLEANUP_P
(
t
))
if
(
CLEANUP_P
(
t
))
{
{
...
@@ -844,8 +819,7 @@ genrtl_try_block (t)
...
@@ -844,8 +819,7 @@ genrtl_try_block (t)
/* Generate the RTL for T, which is an EH_SPEC_BLOCK. */
/* Generate the RTL for T, which is an EH_SPEC_BLOCK. */
static
void
static
void
genrtl_eh_spec_block
(
t
)
genrtl_eh_spec_block
(
tree
t
)
tree
t
;
{
{
expand_eh_region_start
();
expand_eh_region_start
();
expand_stmt
(
EH_SPEC_STMTS
(
t
));
expand_stmt
(
EH_SPEC_STMTS
(
t
));
...
@@ -860,7 +834,7 @@ genrtl_eh_spec_block (t)
...
@@ -860,7 +834,7 @@ genrtl_eh_spec_block (t)
appropriate. */
appropriate. */
tree
tree
begin_try_block
()
begin_try_block
(
void
)
{
{
tree
r
=
build_stmt
(
TRY_BLOCK
,
NULL_TREE
,
NULL_TREE
);
tree
r
=
build_stmt
(
TRY_BLOCK
,
NULL_TREE
,
NULL_TREE
);
add_stmt
(
r
);
add_stmt
(
r
);
...
@@ -870,7 +844,7 @@ begin_try_block ()
...
@@ -870,7 +844,7 @@ begin_try_block ()
/* Likewise, for a function-try-block. */
/* Likewise, for a function-try-block. */
tree
tree
begin_function_try_block
()
begin_function_try_block
(
void
)
{
{
tree
r
=
build_stmt
(
TRY_BLOCK
,
NULL_TREE
,
NULL_TREE
);
tree
r
=
build_stmt
(
TRY_BLOCK
,
NULL_TREE
,
NULL_TREE
);
FN_TRY_BLOCK_P
(
r
)
=
1
;
FN_TRY_BLOCK_P
(
r
)
=
1
;
...
@@ -881,8 +855,7 @@ begin_function_try_block ()
...
@@ -881,8 +855,7 @@ begin_function_try_block ()
/* Finish a try-block, which may be given by TRY_BLOCK. */
/* Finish a try-block, which may be given by TRY_BLOCK. */
void
void
finish_try_block
(
try_block
)
finish_try_block
(
tree
try_block
)
tree
try_block
;
{
{
RECHAIN_STMTS
(
try_block
,
TRY_STMTS
(
try_block
));
RECHAIN_STMTS
(
try_block
,
TRY_STMTS
(
try_block
));
}
}
...
@@ -891,8 +864,7 @@ finish_try_block (try_block)
...
@@ -891,8 +864,7 @@ finish_try_block (try_block)
TRY_BLOCK. */
TRY_BLOCK. */
void
void
finish_cleanup_try_block
(
try_block
)
finish_cleanup_try_block
(
tree
try_block
)
tree
try_block
;
{
{
RECHAIN_STMTS
(
try_block
,
TRY_STMTS
(
try_block
));
RECHAIN_STMTS
(
try_block
,
TRY_STMTS
(
try_block
));
}
}
...
@@ -901,9 +873,7 @@ finish_cleanup_try_block (try_block)
...
@@ -901,9 +873,7 @@ finish_cleanup_try_block (try_block)
by CLEANUP. */
by CLEANUP. */
void
void
finish_cleanup
(
cleanup
,
try_block
)
finish_cleanup
(
tree
cleanup
,
tree
try_block
)
tree
cleanup
;
tree
try_block
;
{
{
TRY_HANDLERS
(
try_block
)
=
cleanup
;
TRY_HANDLERS
(
try_block
)
=
cleanup
;
CLEANUP_P
(
try_block
)
=
1
;
CLEANUP_P
(
try_block
)
=
1
;
...
@@ -912,8 +882,7 @@ finish_cleanup (cleanup, try_block)
...
@@ -912,8 +882,7 @@ finish_cleanup (cleanup, try_block)
/* Likewise, for a function-try-block. */
/* Likewise, for a function-try-block. */
void
void
finish_function_try_block
(
try_block
)
finish_function_try_block
(
tree
try_block
)
tree
try_block
;
{
{
if
(
TREE_CHAIN
(
try_block
)
if
(
TREE_CHAIN
(
try_block
)
&&
TREE_CODE
(
TREE_CHAIN
(
try_block
))
==
CTOR_INITIALIZER
)
&&
TREE_CODE
(
TREE_CHAIN
(
try_block
))
==
CTOR_INITIALIZER
)
...
@@ -932,8 +901,7 @@ finish_function_try_block (try_block)
...
@@ -932,8 +901,7 @@ finish_function_try_block (try_block)
TRY_BLOCK. */
TRY_BLOCK. */
void
void
finish_handler_sequence
(
try_block
)
finish_handler_sequence
(
tree
try_block
)
tree
try_block
;
{
{
RECHAIN_STMTS
(
try_block
,
TRY_HANDLERS
(
try_block
));
RECHAIN_STMTS
(
try_block
,
TRY_HANDLERS
(
try_block
));
check_handlers
(
TRY_HANDLERS
(
try_block
));
check_handlers
(
TRY_HANDLERS
(
try_block
));
...
@@ -942,8 +910,7 @@ finish_handler_sequence (try_block)
...
@@ -942,8 +910,7 @@ finish_handler_sequence (try_block)
/* Likewise, for a function-try-block. */
/* Likewise, for a function-try-block. */
void
void
finish_function_handler_sequence
(
try_block
)
finish_function_handler_sequence
(
tree
try_block
)
tree
try_block
;
{
{
in_function_try_handler
=
0
;
in_function_try_handler
=
0
;
RECHAIN_STMTS
(
try_block
,
TRY_HANDLERS
(
try_block
));
RECHAIN_STMTS
(
try_block
,
TRY_HANDLERS
(
try_block
));
...
@@ -953,8 +920,7 @@ finish_function_handler_sequence (try_block)
...
@@ -953,8 +920,7 @@ finish_function_handler_sequence (try_block)
/* Generate the RTL for T, which is a HANDLER. */
/* Generate the RTL for T, which is a HANDLER. */
static
void
static
void
genrtl_handler
(
t
)
genrtl_handler
(
tree
t
)
tree
t
;
{
{
genrtl_do_pushlevel
();
genrtl_do_pushlevel
();
if
(
!
processing_template_decl
)
if
(
!
processing_template_decl
)
...
@@ -967,7 +933,7 @@ genrtl_handler (t)
...
@@ -967,7 +933,7 @@ genrtl_handler (t)
/* Begin a handler. Returns a HANDLER if appropriate. */
/* Begin a handler. Returns a HANDLER if appropriate. */
tree
tree
begin_handler
()
begin_handler
(
void
)
{
{
tree
r
;
tree
r
;
r
=
build_stmt
(
HANDLER
,
NULL_TREE
,
NULL_TREE
);
r
=
build_stmt
(
HANDLER
,
NULL_TREE
,
NULL_TREE
);
...
@@ -983,9 +949,7 @@ begin_handler ()
...
@@ -983,9 +949,7 @@ begin_handler ()
if this is a `catch (...)' clause. */
if this is a `catch (...)' clause. */
void
void
finish_handler_parms
(
decl
,
handler
)
finish_handler_parms
(
tree
decl
,
tree
handler
)
tree
decl
;
tree
handler
;
{
{
tree
type
=
NULL_TREE
;
tree
type
=
NULL_TREE
;
if
(
processing_template_decl
)
if
(
processing_template_decl
)
...
@@ -1009,8 +973,7 @@ finish_handler_parms (decl, handler)
...
@@ -1009,8 +973,7 @@ finish_handler_parms (decl, handler)
the return value from the matching call to finish_handler_parms. */
the return value from the matching call to finish_handler_parms. */
void
void
finish_handler
(
handler
)
finish_handler
(
tree
handler
)
tree
handler
;
{
{
if
(
!
processing_template_decl
)
if
(
!
processing_template_decl
)
expand_end_catch_block
();
expand_end_catch_block
();
...
@@ -1023,8 +986,7 @@ finish_handler (handler)
...
@@ -1023,8 +986,7 @@ finish_handler (handler)
COMPOUND_STMT if appropriate. */
COMPOUND_STMT if appropriate. */
tree
tree
begin_compound_stmt
(
has_no_scope
)
begin_compound_stmt
(
int
has_no_scope
)
int
has_no_scope
;
{
{
tree
r
;
tree
r
;
int
is_try
=
0
;
int
is_try
=
0
;
...
@@ -1057,9 +1019,7 @@ begin_compound_stmt (has_no_scope)
...
@@ -1057,9 +1019,7 @@ begin_compound_stmt (has_no_scope)
a scope. */
a scope. */
tree
tree
finish_compound_stmt
(
has_no_scope
,
compound_stmt
)
finish_compound_stmt
(
int
has_no_scope
,
tree
compound_stmt
)
int
has_no_scope
;
tree
compound_stmt
;
{
{
tree
r
;
tree
r
;
tree
t
;
tree
t
;
...
@@ -1087,13 +1047,11 @@ finish_compound_stmt (has_no_scope, compound_stmt)
...
@@ -1087,13 +1047,11 @@ finish_compound_stmt (has_no_scope, compound_stmt)
CLOBBERS. */
CLOBBERS. */
tree
tree
finish_asm_stmt
(
cv_qualifier
,
string
,
output_operands
,
finish_asm_stmt
(
tree
cv_qualifier
,
input_operands
,
clobbers
)
tree
string
,
tree
cv_qualifier
;
tree
output_operands
,
tree
string
;
tree
input_operands
,
tree
output_operands
;
tree
clobbers
)
tree
input_operands
;
tree
clobbers
;
{
{
tree
r
;
tree
r
;
tree
t
;
tree
t
;
...
@@ -1176,8 +1134,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
...
@@ -1176,8 +1134,7 @@ finish_asm_stmt (cv_qualifier, string, output_operands,
/* Finish a label with the indicated NAME. */
/* Finish a label with the indicated NAME. */
tree
tree
finish_label_stmt
(
name
)
finish_label_stmt
(
tree
name
)
tree
name
;
{
{
tree
decl
=
define_label
(
input_filename
,
input_line
,
name
);
tree
decl
=
define_label
(
input_filename
,
input_line
,
name
);
return
add_stmt
(
build_stmt
(
LABEL_STMT
,
decl
));
return
add_stmt
(
build_stmt
(
LABEL_STMT
,
decl
));
...
@@ -1188,8 +1145,7 @@ finish_label_stmt (name)
...
@@ -1188,8 +1145,7 @@ finish_label_stmt (name)
is useful when writing code involving statement-expressions. */
is useful when writing code involving statement-expressions. */
void
void
finish_label_decl
(
name
)
finish_label_decl
(
tree
name
)
tree
name
;
{
{
tree
decl
=
declare_local_label
(
name
);
tree
decl
=
declare_local_label
(
name
);
add_decl_stmt
(
decl
);
add_decl_stmt
(
decl
);
...
@@ -1198,9 +1154,7 @@ finish_label_decl (name)
...
@@ -1198,9 +1154,7 @@ finish_label_decl (name)
/* When DECL goes out of scope, make sure that CLEANUP is executed. */
/* When DECL goes out of scope, make sure that CLEANUP is executed. */
void
void
finish_decl_cleanup
(
decl
,
cleanup
)
finish_decl_cleanup
(
tree
decl
,
tree
cleanup
)
tree
decl
;
tree
cleanup
;
{
{
add_stmt
(
build_stmt
(
CLEANUP_STMT
,
decl
,
cleanup
));
add_stmt
(
build_stmt
(
CLEANUP_STMT
,
decl
,
cleanup
));
}
}
...
@@ -1208,8 +1162,7 @@ finish_decl_cleanup (decl, cleanup)
...
@@ -1208,8 +1162,7 @@ finish_decl_cleanup (decl, cleanup)
/* If the current scope exits with an exception, run CLEANUP. */
/* If the current scope exits with an exception, run CLEANUP. */
void
void
finish_eh_cleanup
(
cleanup
)
finish_eh_cleanup
(
tree
cleanup
)
tree
cleanup
;
{
{
tree
r
=
build_stmt
(
CLEANUP_STMT
,
NULL_TREE
,
cleanup
);
tree
r
=
build_stmt
(
CLEANUP_STMT
,
NULL_TREE
,
cleanup
);
CLEANUP_EH_ONLY
(
r
)
=
1
;
CLEANUP_EH_ONLY
(
r
)
=
1
;
...
@@ -1236,7 +1189,7 @@ finish_mem_initializers (tree mem_inits)
...
@@ -1236,7 +1189,7 @@ finish_mem_initializers (tree mem_inits)
/* Returns the stack of SCOPE_STMTs for the current function. */
/* Returns the stack of SCOPE_STMTs for the current function. */
tree
*
tree
*
current_scope_stmt_stack
()
current_scope_stmt_stack
(
void
)
{
{
return
&
cfun
->
language
->
base
.
x_scope_stmt_stack
;
return
&
cfun
->
language
->
base
.
x_scope_stmt_stack
;
}
}
...
@@ -1244,8 +1197,7 @@ current_scope_stmt_stack ()
...
@@ -1244,8 +1197,7 @@ current_scope_stmt_stack ()
/* Finish a parenthesized expression EXPR. */
/* Finish a parenthesized expression EXPR. */
tree
tree
finish_parenthesized_expr
(
expr
)
finish_parenthesized_expr
(
tree
expr
)
tree
expr
;
{
{
if
(
IS_EXPR_CODE_CLASS
(
TREE_CODE_CLASS
(
TREE_CODE
(
expr
))))
if
(
IS_EXPR_CODE_CLASS
(
TREE_CODE_CLASS
(
TREE_CODE
(
expr
))))
/* This inhibits warnings in c_common_truthvalue_conversion. */
/* This inhibits warnings in c_common_truthvalue_conversion. */
...
@@ -1324,7 +1276,7 @@ finish_non_static_data_member (tree decl, tree qualifying_scope)
...
@@ -1324,7 +1276,7 @@ finish_non_static_data_member (tree decl, tree qualifying_scope)
finish_stmt_expr. */
finish_stmt_expr. */
tree
tree
begin_stmt_expr
()
begin_stmt_expr
(
void
)
{
{
/* If we're outside a function, we won't have a statement-tree to
/* If we're outside a function, we won't have a statement-tree to
work with. But, if we see a statement-expression we need to
work with. But, if we see a statement-expression we need to
...
@@ -1345,7 +1297,7 @@ begin_stmt_expr ()
...
@@ -1345,7 +1297,7 @@ begin_stmt_expr ()
function. */
function. */
tree
tree
begin_global_stmt_expr
()
begin_global_stmt_expr
(
void
)
{
{
if
(
!
cfun
&&
!
last_tree
)
if
(
!
cfun
&&
!
last_tree
)
begin_stmt_tree
(
&
scope_chain
->
x_saved_tree
);
begin_stmt_tree
(
&
scope_chain
->
x_saved_tree
);
...
@@ -1358,8 +1310,7 @@ begin_global_stmt_expr ()
...
@@ -1358,8 +1310,7 @@ begin_global_stmt_expr ()
/* Finish the STMT_EXPR last begun with begin_global_stmt_expr. */
/* Finish the STMT_EXPR last begun with begin_global_stmt_expr. */
tree
tree
finish_global_stmt_expr
(
stmt_expr
)
finish_global_stmt_expr
(
tree
stmt_expr
)
tree
stmt_expr
;
{
{
stmt_expr
=
expand_end_stmt_expr
(
stmt_expr
);
stmt_expr
=
expand_end_stmt_expr
(
stmt_expr
);
...
@@ -1376,8 +1327,7 @@ finish_global_stmt_expr (stmt_expr)
...
@@ -1376,8 +1327,7 @@ finish_global_stmt_expr (stmt_expr)
statement-expression. */
statement-expression. */
tree
tree
finish_stmt_expr
(
rtl_expr
)
finish_stmt_expr
(
tree
rtl_expr
)
tree
rtl_expr
;
{
{
tree
result
;
tree
result
;
...
@@ -1523,9 +1473,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual)
...
@@ -1523,9 +1473,7 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual)
POSTDECREMENT_EXPR.) */
POSTDECREMENT_EXPR.) */
tree
tree
finish_increment_expr
(
expr
,
code
)
finish_increment_expr
(
tree
expr
,
enum
tree_code
code
)
tree
expr
;
enum
tree_code
code
;
{
{
/* If we get an OFFSET_REF, turn it into what it really means (e.g.,
/* If we get an OFFSET_REF, turn it into what it really means (e.g.,
a COMPONENT_REF). This way if we've got, say, a reference to a
a COMPONENT_REF). This way if we've got, say, a reference to a
...
@@ -1540,7 +1488,7 @@ finish_increment_expr (expr, code)
...
@@ -1540,7 +1488,7 @@ finish_increment_expr (expr, code)
/* Finish a use of `this'. Returns an expression for `this'. */
/* Finish a use of `this'. Returns an expression for `this'. */
tree
tree
finish_this_expr
()
finish_this_expr
(
void
)
{
{
tree
result
;
tree
result
;
...
@@ -1570,10 +1518,7 @@ finish_this_expr ()
...
@@ -1570,10 +1518,7 @@ finish_this_expr ()
FN. Returns an expression for the call. */
FN. Returns an expression for the call. */
tree
tree
finish_object_call_expr
(
fn
,
object
,
args
)
finish_object_call_expr
(
tree
fn
,
tree
object
,
tree
args
)
tree
fn
;
tree
object
;
tree
args
;
{
{
if
(
DECL_DECLARES_TYPE_P
(
fn
))
if
(
DECL_DECLARES_TYPE_P
(
fn
))
{
{
...
@@ -1609,10 +1554,7 @@ finish_object_call_expr (fn, object, args)
...
@@ -1609,10 +1554,7 @@ finish_object_call_expr (fn, object, args)
arguments to FN. Returns an expression for the call. */
arguments to FN. Returns an expression for the call. */
tree
tree
finish_qualified_object_call_expr
(
fn
,
object
,
args
)
finish_qualified_object_call_expr
(
tree
fn
,
tree
object
,
tree
args
)
tree
fn
;
tree
object
;
tree
args
;
{
{
return
build_scoped_method_call
(
object
,
TREE_OPERAND
(
fn
,
0
),
return
build_scoped_method_call
(
object
,
TREE_OPERAND
(
fn
,
0
),
TREE_OPERAND
(
fn
,
1
),
args
);
TREE_OPERAND
(
fn
,
1
),
args
);
...
@@ -1624,10 +1566,7 @@ finish_qualified_object_call_expr (fn, object, args)
...
@@ -1624,10 +1566,7 @@ finish_qualified_object_call_expr (fn, object, args)
was of the form `OBJECT.SCOPE::~DESTRUCTOR'. */
was of the form `OBJECT.SCOPE::~DESTRUCTOR'. */
tree
tree
finish_pseudo_destructor_expr
(
object
,
scope
,
destructor
)
finish_pseudo_destructor_expr
(
tree
object
,
tree
scope
,
tree
destructor
)
tree
object
;
tree
scope
;
tree
destructor
;
{
{
if
(
destructor
==
error_mark_node
)
if
(
destructor
==
error_mark_node
)
return
error_mark_node
;
return
error_mark_node
;
...
@@ -1655,9 +1594,7 @@ finish_pseudo_destructor_expr (object, scope, destructor)
...
@@ -1655,9 +1594,7 @@ finish_pseudo_destructor_expr (object, scope, destructor)
/* Finish an expression of the form CODE EXPR. */
/* Finish an expression of the form CODE EXPR. */
tree
tree
finish_unary_op_expr
(
code
,
expr
)
finish_unary_op_expr
(
enum
tree_code
code
,
tree
expr
)
enum
tree_code
code
;
tree
expr
;
{
{
tree
result
=
build_x_unary_op
(
code
,
expr
);
tree
result
=
build_x_unary_op
(
code
,
expr
);
/* Inside a template, build_x_unary_op does not fold the
/* Inside a template, build_x_unary_op does not fold the
...
@@ -1676,9 +1613,7 @@ finish_unary_op_expr (code, expr)
...
@@ -1676,9 +1613,7 @@ finish_unary_op_expr (code, expr)
the INITIALIZER_LIST is being cast. */
the INITIALIZER_LIST is being cast. */
tree
tree
finish_compound_literal
(
type
,
initializer_list
)
finish_compound_literal
(
tree
type
,
tree
initializer_list
)
tree
type
;
tree
initializer_list
;
{
{
tree
compound_literal
;
tree
compound_literal
;
...
@@ -1724,10 +1659,7 @@ finish_fname (tree id)
...
@@ -1724,10 +1659,7 @@ finish_fname (tree id)
valid. */
valid. */
int
int
begin_function_definition
(
decl_specs
,
attributes
,
declarator
)
begin_function_definition
(
tree
decl_specs
,
tree
attributes
,
tree
declarator
)
tree
decl_specs
;
tree
attributes
;
tree
declarator
;
{
{
if
(
!
start_function
(
decl_specs
,
declarator
,
attributes
,
SF_DEFAULT
))
if
(
!
start_function
(
decl_specs
,
declarator
,
attributes
,
SF_DEFAULT
))
return
0
;
return
0
;
...
@@ -1742,7 +1674,7 @@ begin_function_definition (decl_specs, attributes, declarator)
...
@@ -1742,7 +1674,7 @@ begin_function_definition (decl_specs, attributes, declarator)
/* Finish a translation unit. */
/* Finish a translation unit. */
void
void
finish_translation_unit
()
finish_translation_unit
(
void
)
{
{
/* In case there were missing closebraces,
/* In case there were missing closebraces,
get us back to the global binding level. */
get us back to the global binding level. */
...
@@ -1758,9 +1690,7 @@ finish_translation_unit ()
...
@@ -1758,9 +1690,7 @@ finish_translation_unit ()
Returns the parameter. */
Returns the parameter. */
tree
tree
finish_template_type_parm
(
aggr
,
identifier
)
finish_template_type_parm
(
tree
aggr
,
tree
identifier
)
tree
aggr
;
tree
identifier
;
{
{
if
(
aggr
!=
class_type_node
)
if
(
aggr
!=
class_type_node
)
{
{
...
@@ -1775,9 +1705,7 @@ finish_template_type_parm (aggr, identifier)
...
@@ -1775,9 +1705,7 @@ finish_template_type_parm (aggr, identifier)
Returns the parameter. */
Returns the parameter. */
tree
tree
finish_template_template_parm
(
aggr
,
identifier
)
finish_template_template_parm
(
tree
aggr
,
tree
identifier
)
tree
aggr
;
tree
identifier
;
{
{
tree
decl
=
build_decl
(
TYPE_DECL
,
identifier
,
NULL_TREE
);
tree
decl
=
build_decl
(
TYPE_DECL
,
identifier
,
NULL_TREE
);
tree
tmpl
=
build_lang_decl
(
TEMPLATE_DECL
,
identifier
,
NULL_TREE
);
tree
tmpl
=
build_lang_decl
(
TEMPLATE_DECL
,
identifier
,
NULL_TREE
);
...
@@ -1814,9 +1742,7 @@ check_template_template_default_arg (tree argument)
...
@@ -1814,9 +1742,7 @@ check_template_template_default_arg (tree argument)
nonzero, the parameter list was terminated by a `...'. */
nonzero, the parameter list was terminated by a `...'. */
tree
tree
finish_parmlist
(
parms
,
ellipsis
)
finish_parmlist
(
tree
parms
,
int
ellipsis
)
tree
parms
;
int
ellipsis
;
{
{
if
(
parms
)
if
(
parms
)
{
{
...
@@ -1833,8 +1759,7 @@ finish_parmlist (parms, ellipsis)
...
@@ -1833,8 +1759,7 @@ finish_parmlist (parms, ellipsis)
/* Begin a class definition, as indicated by T. */
/* Begin a class definition, as indicated by T. */
tree
tree
begin_class_definition
(
t
)
begin_class_definition
(
tree
t
)
tree
t
;
{
{
if
(
t
==
error_mark_node
)
if
(
t
==
error_mark_node
)
return
error_mark_node
;
return
error_mark_node
;
...
@@ -1903,8 +1828,7 @@ begin_class_definition (t)
...
@@ -1903,8 +1828,7 @@ begin_class_definition (t)
/* Finish the member declaration given by DECL. */
/* Finish the member declaration given by DECL. */
void
void
finish_member_declaration
(
decl
)
finish_member_declaration
(
tree
decl
)
tree
decl
;
{
{
if
(
decl
==
error_mark_node
||
decl
==
NULL_TREE
)
if
(
decl
==
error_mark_node
||
decl
==
NULL_TREE
)
return
;
return
;
...
@@ -1992,11 +1916,7 @@ finish_member_declaration (decl)
...
@@ -1992,11 +1916,7 @@ finish_member_declaration (decl)
type. */
type. */
tree
tree
finish_class_definition
(
t
,
attributes
,
semi
,
pop_scope_p
)
finish_class_definition
(
tree
t
,
tree
attributes
,
int
semi
,
int
pop_scope_p
)
tree
t
;
tree
attributes
;
int
semi
;
int
pop_scope_p
;
{
{
if
(
t
==
error_mark_node
)
if
(
t
==
error_mark_node
)
return
error_mark_node
;
return
error_mark_node
;
...
@@ -2030,8 +1950,7 @@ finish_class_definition (t, attributes, semi, pop_scope_p)
...
@@ -2030,8 +1950,7 @@ finish_class_definition (t, attributes, semi, pop_scope_p)
TYPES whose template parameters are given by PARMS. */
TYPES whose template parameters are given by PARMS. */
tree
tree
finish_member_class_template
(
types
)
finish_member_class_template
(
tree
types
)
tree
types
;
{
{
tree
t
;
tree
t
;
...
@@ -2062,8 +1981,7 @@ finish_member_class_template (types)
...
@@ -2062,8 +1981,7 @@ finish_member_class_template (types)
the template parameters. */
the template parameters. */
void
void
finish_template_decl
(
parms
)
finish_template_decl
(
tree
parms
)
tree
parms
;
{
{
if
(
parms
)
if
(
parms
)
end_template_decl
();
end_template_decl
();
...
@@ -2077,10 +1995,7 @@ finish_template_decl (parms)
...
@@ -2077,10 +1995,7 @@ finish_template_decl (parms)
the scope of template-id indicated. */
the scope of template-id indicated. */
tree
tree
finish_template_type
(
name
,
args
,
entering_scope
)
finish_template_type
(
tree
name
,
tree
args
,
int
entering_scope
)
tree
name
;
tree
args
;
int
entering_scope
;
{
{
tree
decl
;
tree
decl
;
...
@@ -2129,7 +2044,7 @@ finish_base_specifier (tree base, tree access, bool virtual_p)
...
@@ -2129,7 +2044,7 @@ finish_base_specifier (tree base, tree access, bool virtual_p)
premitted in this context, an error is issued. */
premitted in this context, an error is issued. */
void
void
check_multiple_declarators
()
check_multiple_declarators
(
void
)
{
{
/* [temp]
/* [temp]
...
@@ -2154,8 +2069,7 @@ check_multiple_declarators ()
...
@@ -2154,8 +2069,7 @@ check_multiple_declarators ()
use as a type-specifier. */
use as a type-specifier. */
tree
tree
finish_typeof
(
expr
)
finish_typeof
(
tree
expr
)
tree
expr
;
{
{
tree
type
;
tree
type
;
...
@@ -2184,8 +2098,7 @@ finish_typeof (expr)
...
@@ -2184,8 +2098,7 @@ finish_typeof (expr)
/* Compute the value of the `sizeof' operator. */
/* Compute the value of the `sizeof' operator. */
tree
tree
finish_sizeof
(
t
)
finish_sizeof
(
tree
t
)
tree
t
;
{
{
return
TYPE_P
(
t
)
?
cxx_sizeof
(
t
)
:
expr_sizeof
(
t
);
return
TYPE_P
(
t
)
?
cxx_sizeof
(
t
)
:
expr_sizeof
(
t
);
}
}
...
@@ -2194,8 +2107,7 @@ finish_sizeof (t)
...
@@ -2194,8 +2107,7 @@ finish_sizeof (t)
alignment of T, measured in bytes. */
alignment of T, measured in bytes. */
tree
tree
finish_alignof
(
t
)
finish_alignof
(
tree
t
)
tree
t
;
{
{
if
(
processing_template_decl
)
if
(
processing_template_decl
)
return
build_min
(
ALIGNOF_EXPR
,
size_type_node
,
t
);
return
build_min
(
ALIGNOF_EXPR
,
size_type_node
,
t
);
...
@@ -2207,8 +2119,7 @@ finish_alignof (t)
...
@@ -2207,8 +2119,7 @@ finish_alignof (t)
other statements at its nesting level. */
other statements at its nesting level. */
static
void
static
void
cp_expand_stmt
(
t
)
cp_expand_stmt
(
tree
t
)
tree
t
;
{
{
switch
(
TREE_CODE
(
t
))
switch
(
TREE_CODE
(
t
))
{
{
...
@@ -2237,10 +2148,9 @@ cp_expand_stmt (t)
...
@@ -2237,10 +2148,9 @@ cp_expand_stmt (t)
will equivalent CALL_EXPRs. */
will equivalent CALL_EXPRs. */
static
tree
static
tree
simplify_aggr_init_exprs_r
(
tp
,
walk_subtrees
,
data
)
simplify_aggr_init_exprs_r
(
tree
*
tp
,
tree
*
tp
;
int
*
walk_subtrees
ATTRIBUTE_UNUSED
,
int
*
walk_subtrees
ATTRIBUTE_UNUSED
;
void
*
data
ATTRIBUTE_UNUSED
)
void
*
data
ATTRIBUTE_UNUSED
;
{
{
tree
aggr_init_expr
;
tree
aggr_init_expr
;
tree
call_expr
;
tree
call_expr
;
...
@@ -2335,8 +2245,7 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
...
@@ -2335,8 +2245,7 @@ simplify_aggr_init_exprs_r (tp, walk_subtrees, data)
/* Emit all thunks to FN that should be emitted when FN is emitted. */
/* Emit all thunks to FN that should be emitted when FN is emitted. */
static
void
static
void
emit_associated_thunks
(
fn
)
emit_associated_thunks
(
tree
fn
)
tree
fn
;
{
{
/* When we use vcall offsets, we emit thunks with the virtual
/* When we use vcall offsets, we emit thunks with the virtual
functions to which they thunk. The whole point of vcall offsets
functions to which they thunk. The whole point of vcall offsets
...
@@ -2365,8 +2274,7 @@ emit_associated_thunks (fn)
...
@@ -2365,8 +2274,7 @@ emit_associated_thunks (fn)
/* Generate RTL for FN. */
/* Generate RTL for FN. */
void
void
expand_body
(
fn
)
expand_body
(
tree
fn
)
tree
fn
;
{
{
location_t
saved_loc
;
location_t
saved_loc
;
tree
saved_function
;
tree
saved_function
;
...
@@ -2509,10 +2417,7 @@ expand_body (fn)
...
@@ -2509,10 +2417,7 @@ expand_body (fn)
value optimization. */
value optimization. */
tree
tree
nullify_returns_r
(
tp
,
walk_subtrees
,
data
)
nullify_returns_r
(
tree
*
tp
,
int
*
walk_subtrees
,
void
*
data
)
tree
*
tp
;
int
*
walk_subtrees
;
void
*
data
;
{
{
tree
nrv
=
(
tree
)
data
;
tree
nrv
=
(
tree
)
data
;
...
@@ -2533,8 +2438,7 @@ nullify_returns_r (tp, walk_subtrees, data)
...
@@ -2533,8 +2438,7 @@ nullify_returns_r (tp, walk_subtrees, data)
/* Start generating the RTL for FN. */
/* Start generating the RTL for FN. */
static
void
static
void
genrtl_start_function
(
fn
)
genrtl_start_function
(
tree
fn
)
tree
fn
;
{
{
/* Tell everybody what function we're processing. */
/* Tell everybody what function we're processing. */
current_function_decl
=
fn
;
current_function_decl
=
fn
;
...
@@ -2595,8 +2499,7 @@ genrtl_start_function (fn)
...
@@ -2595,8 +2499,7 @@ genrtl_start_function (fn)
/* Finish generating the RTL for FN. */
/* Finish generating the RTL for FN. */
static
void
static
void
genrtl_finish_function
(
fn
)
genrtl_finish_function
(
tree
fn
)
tree
fn
;
{
{
tree
t
;
tree
t
;
...
@@ -2717,10 +2620,9 @@ genrtl_finish_function (fn)
...
@@ -2717,10 +2620,9 @@ genrtl_finish_function (fn)
its sub-blocks. */
its sub-blocks. */
static
tree
static
tree
clear_decl_rtl
(
tp
,
walk_subtrees
,
data
)
clear_decl_rtl
(
tree
*
tp
,
tree
*
tp
;
int
*
walk_subtrees
ATTRIBUTE_UNUSED
,
int
*
walk_subtrees
ATTRIBUTE_UNUSED
;
void
*
data
ATTRIBUTE_UNUSED
)
void
*
data
ATTRIBUTE_UNUSED
;
{
{
if
(
nonstatic_local_decl_p
(
*
tp
))
if
(
nonstatic_local_decl_p
(
*
tp
))
SET_DECL_RTL
(
*
tp
,
NULL_RTX
);
SET_DECL_RTL
(
*
tp
,
NULL_RTX
);
...
@@ -2731,7 +2633,7 @@ clear_decl_rtl (tp, walk_subtrees, data)
...
@@ -2731,7 +2633,7 @@ clear_decl_rtl (tp, walk_subtrees, data)
/* Perform initialization related to this module. */
/* Perform initialization related to this module. */
void
void
init_cp_semantics
()
init_cp_semantics
(
void
)
{
{
lang_expand_stmt
=
cp_expand_stmt
;
lang_expand_stmt
=
cp_expand_stmt
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment