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