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
878cd289
Commit
878cd289
authored
May 27, 1995
by
Mike Stump
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
73rd Cygnus<->FSF merge
From-SVN: r9826
parent
73b73053
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
213 additions
and
78 deletions
+213
-78
gcc/cp/ChangeLog
+58
-0
gcc/cp/call.c
+9
-5
gcc/cp/cp-tree.h
+4
-0
gcc/cp/cvt.c
+32
-14
gcc/cp/decl.c
+21
-20
gcc/cp/method.c
+1
-2
gcc/cp/tree.c
+68
-32
gcc/cp/typeck.c
+17
-5
gcc/cp/typeck2.c
+3
-0
No files found.
gcc/cp/ChangeLog
View file @
878cd289
...
...
@@ -17,8 +17,66 @@ Mon May 22 17:38:48 1995 Richard Kenner (kenner@vlsi1.ultra.nyu.edu)
(c++.mostlyclean, stage[1-4]): Use $(objext) in object file names.
* Makefile.in (../cc1plus): Use $(exeext) in name of executable.
Wed May 24 01:39:03 1995 Jason Merrill <jason@deneb.cygnus.com>
* call.c (build_method_call): parms can be null, duh.
Tue May 23 01:32:09 1995 Jason Merrill <jason@deneb.cygnus.com>
* call.c (build_method_call): If convert_arguments failed, just bail.
Fri May 19 10:31:11 1995 Jason Merrill <jason@phydeaux.cygnus.com>
* cvt.c (convert_force): Pass LOOKUP_NORMAL to cp_convert.
* tree.c (copy_to_permanent): Oops.
Fri May 19 10:01:07 1995 Brendan Kehoe (brendan@lisa.cygnus.com)
* cp-tree.h (break_out_target_exprs): Add decl.
Thu May 18 13:02:30 1995 Jason Merrill <jason@phydeaux.cygnus.com>
* decl.c (start_function): Move *all* interface handling stuff after
the pushdecl.
* tree.c (mapcar): Renamed from make_deep_copy and generalized.
(perm_manip): Return t if permanent, otherwise 0.
(copy_to_permanent): Use them.
(bot_manip): Helper for break_out_target_exprs.
(break_out_target_exprs): New function. Uses mapcar.
* typeck.c (convert_arguments): Use it.
* method.c (hack_identifier): Use convert_from_reference to
dereference a reference.
Wed May 17 17:54:54 1995 Mike Stump <mrs@cygnus.com>
* call.c (convert_harshness): Move reference bashing before pointer
to member bashing.
Wed May 17 16:57:53 1995 Mike Stump <mrs@cygnus.com>
* cvt.c (convert_to_reference): Only complain, if complaints are
wanted.
typeck.c (build_function_call_real): Ditto. If LOOKUP_SPECULATIVELY
is set and something won't work, return NULL_TREE.
cvt.c (cp_convert): Ditto. Pass flags down to build_method_call.
(convert): Pass LOOKUP_NORMAL to cp_convert.
typeck.c (convert_for_assignment): Ditto.
(convert_force): Pass LOOKUP_COMPLAIN to cp_convert.
typeck.c (convert_arguments): Get out early if we get an
error_mark_node.
(convert_for_initialization): Use cp_convert instead of convert so
that we can pass flags down.
* cp-tree.h (LOOKUP_SPECULATIVELY): Added documentation.
Wed May 17 01:43:58 1995 Jason Merrill <jason@phydeaux.cygnus.com>
* typeck2.c (store_init_value): Don't take the MAIN_VARIANT of the
decl type.
* class.c (finish_struct): Don't complain about a class with no
user-defined constructors but with a member that has no default
constructor, as this is OK for aggregates.
...
...
gcc/cp/call.c
View file @
878cd289
...
...
@@ -129,11 +129,6 @@ convert_harshness (type, parmtype, parm)
n_convert_harshness
++
;
#endif
if
(
TYPE_PTRMEMFUNC_P
(
type
))
type
=
TYPE_PTRMEMFUNC_FN_TYPE
(
type
);
if
(
TYPE_PTRMEMFUNC_P
(
parmtype
))
parmtype
=
TYPE_PTRMEMFUNC_FN_TYPE
(
parmtype
);
if
(
TREE_CODE
(
parmtype
)
==
REFERENCE_TYPE
)
{
if
(
parm
)
...
...
@@ -146,6 +141,11 @@ convert_harshness (type, parmtype, parm)
else
lvalue
=
0
;
if
(
TYPE_PTRMEMFUNC_P
(
type
))
type
=
TYPE_PTRMEMFUNC_FN_TYPE
(
type
);
if
(
TYPE_PTRMEMFUNC_P
(
parmtype
))
parmtype
=
TYPE_PTRMEMFUNC_FN_TYPE
(
parmtype
);
codel
=
TREE_CODE
(
type
);
coder
=
TREE_CODE
(
parmtype
);
...
...
@@ -2635,6 +2635,10 @@ build_method_call (instance, name, parms, basetype_path, flags)
}
#endif
if
(
parms
==
error_mark_node
||
(
parms
&&
TREE_CHAIN
(
parms
)
==
error_mark_node
))
return
error_mark_node
;
if
(
need_vtbl
==
needed
)
{
function
=
build_vfn_ref
(
&
TREE_VALUE
(
parms
),
instance
,
...
...
gcc/cp/cp-tree.h
View file @
878cd289
...
...
@@ -1825,6 +1825,9 @@ extern tree current_class_type; /* _TYPE: the type of the current class */
LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already
in the parameter list.
LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
after. Note, LOOKUP_COMPLAIN is checked and error messages printed
before LOOKUP_SPECULATIVELY is checked.
LOOKUP_NO_CONVERSION means that user-defined conversions are not
permitted. Built-in conversions are permitted.
LOOKUP_DESTRUCTOR means explicit call to destructor. */
...
...
@@ -2361,6 +2364,7 @@ extern void print_lang_statistics PROTO((void));
/* skip __eprintf */
extern
tree
array_type_nelts_total
PROTO
((
tree
));
extern
tree
array_type_nelts_top
PROTO
((
tree
));
extern
tree
break_out_target_exprs
PROTO
((
tree
));
/* in typeck.c */
extern
tree
condition_conversion
PROTO
((
tree
));
...
...
gcc/cp/cvt.c
View file @
878cd289
...
...
@@ -836,12 +836,12 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
my_friendly_assert
(
TREE_CODE
(
intype
)
!=
OFFSET_TYPE
,
189
);
if
(
flags
&
LOOKUP_COMPLAIN
)
cp_error
(
"cannot convert type `%T' to type `%T'"
,
intype
,
reftype
);
if
(
flags
&
LOOKUP_SPECULATIVELY
)
return
NULL_TREE
;
else
if
(
flags
&
LOOKUP_COMPLAIN
)
cp_error
(
"cannot convert type `%T' to type `%T'"
,
intype
,
reftype
);
return
error_mark_node
;
}
...
...
@@ -1190,6 +1190,10 @@ convert_pointer_to_vbase (binfo, expr)
return
NULL_TREE
;
}
/* Conversion...
FLAGS indicates how we should behave. */
tree
cp_convert
(
type
,
expr
,
convtype
,
flags
)
tree
type
,
expr
;
...
...
@@ -1259,7 +1263,10 @@ cp_convert (type, expr, convtype, flags)
rval
=
build_type_conversion
(
CONVERT_EXPR
,
type
,
e
,
1
);
if
(
rval
)
return
rval
;
cp_error
(
"`%#T' used where a `%T' was expected"
,
intype
,
type
);
if
(
flags
&
LOOKUP_COMPLAIN
)
cp_error
(
"`%#T' used where a `%T' was expected"
,
intype
,
type
);
if
(
flags
&
LOOKUP_SPECULATIVELY
)
return
NULL_TREE
;
return
error_mark_node
;
}
if
(
code
==
BOOLEAN_TYPE
)
...
...
@@ -1278,8 +1285,9 @@ cp_convert (type, expr, convtype, flags)
if
(
rval
)
return
rval
;
else
cp_error
(
"`%#T' used where a floating point value was expected"
,
TREE_TYPE
(
e
));
if
(
flags
&
LOOKUP_COMPLAIN
)
cp_error
(
"`%#T' used where a floating point value was expected"
,
TREE_TYPE
(
e
));
}
return
fold
(
convert_to_real
(
type
,
e
));
}
...
...
@@ -1331,7 +1339,8 @@ cp_convert (type, expr, convtype, flags)
if
(
conversion
==
error_mark_node
)
{
error
(
"ambiguous pointer conversion"
);
if
(
flags
&
LOOKUP_COMPLAIN
)
error
(
"ambiguous pointer conversion"
);
return
conversion
;
}
...
...
@@ -1339,19 +1348,25 @@ cp_convert (type, expr, convtype, flags)
ctor
=
build_method_call
(
NULL_TREE
,
constructor_name_full
(
type
),
build_tree_list
(
NULL_TREE
,
e
),
TYPE_BINFO
(
type
),
LOOKUP_NORMAL
|
LOOKUP_SPECULATIVELY
(
flags
&
LOOKUP_NORMAL
)
|
LOOKUP_SPECULATIVELY
|
(
convtype
&
CONV_NONCONVERTING
?
0
:
LOOKUP_ONLYCONVERTING
)
|
(
conversion
?
LOOKUP_NO_CONVERSION
:
0
));
if
(
ctor
==
error_mark_node
)
{
cp_error
(
"in conversion to type `%T'"
,
type
);
if
(
flags
&
LOOKUP_COMPLAIN
)
cp_error
(
"in conversion to type `%T'"
,
type
);
if
(
flags
&
LOOKUP_SPECULATIVELY
)
return
NULL_TREE
;
return
error_mark_node
;
}
if
(
conversion
&&
ctor
)
{
error
(
"both constructor and type conversion operator apply"
);
if
(
flags
&
LOOKUP_COMPLAIN
)
error
(
"both constructor and type conversion operator apply"
);
if
(
flags
&
LOOKUP_SPECULATIVELY
)
return
NULL_TREE
;
return
error_mark_node
;
}
else
if
(
conversion
)
...
...
@@ -1408,8 +1423,11 @@ cp_convert (type, expr, convtype, flags)
&&
index_type_equal
(
TYPE_DOMAIN
(
TREE_TYPE
(
e
)),
TYPE_DOMAIN
(
type
)))
return
e
;
cp_error
(
"conversion from `%T' to non-scalar type `%T' requested"
,
TREE_TYPE
(
expr
),
type
);
if
(
flags
&
LOOKUP_COMPLAIN
)
cp_error
(
"conversion from `%T' to non-scalar type `%T' requested"
,
TREE_TYPE
(
expr
),
type
);
if
(
flags
&
LOOKUP_SPECULATIVELY
)
return
NULL_TREE
;
return
error_mark_node
;
}
...
...
@@ -1423,7 +1441,7 @@ tree
convert
(
type
,
expr
)
tree
type
,
expr
;
{
return
cp_convert
(
type
,
expr
,
CONV_OLD_CONVERT
,
0
);
return
cp_convert
(
type
,
expr
,
CONV_OLD_CONVERT
,
LOOKUP_NORMAL
);
}
/* Like convert, except permit conversions to take place which
...
...
@@ -1459,7 +1477,7 @@ convert_force (type, expr, convtype)
return
build_ptrmemfunc
(
TYPE_PTRMEMFUNC_FN_TYPE
(
type
),
e
,
1
);
}
return
cp_convert
(
type
,
e
,
CONV_C_CAST
|
convtype
,
0
);
return
cp_convert
(
type
,
e
,
CONV_C_CAST
|
convtype
,
LOOKUP_NORMAL
);
}
/* Subroutine of build_type_conversion. */
...
...
gcc/cp/decl.c
View file @
878cd289
...
...
@@ -11129,6 +11129,19 @@ start_function (declspecs, declarator, raises, pre_parsed_p)
(This does not mean `static' in the C sense!) */
TREE_STATIC
(
decl1
)
=
1
;
/* Record the decl so that the function name is defined.
If we already have a decl for this name, and it is a FUNCTION_DECL,
use the old decl. */
if
(
pre_parsed_p
==
0
)
{
current_function_decl
=
decl1
=
pushdecl
(
decl1
);
DECL_MAIN_VARIANT
(
decl1
)
=
decl1
;
fntype
=
TREE_TYPE
(
decl1
);
}
else
current_function_decl
=
decl1
;
if
(
DECL_INTERFACE_KNOWN
(
decl1
))
{
if
(
DECL_NOT_REALLY_EXTERN
(
decl1
))
...
...
@@ -11154,27 +11167,15 @@ start_function (declspecs, declarator, raises, pre_parsed_p)
So clear DECL_EXTERNAL. */
DECL_EXTERNAL
(
decl1
)
=
0
;
if
(
DECL_C_STATIC
(
decl1
))
TREE_PUBLIC
(
decl1
)
=
0
;
}
/* Record the decl so that the function name is defined.
If we already have a decl for this name, and it is a FUNCTION_DECL,
use the old decl. */
if
(
pre_parsed_p
==
0
)
{
current_function_decl
=
decl1
=
pushdecl
(
decl1
);
DECL_MAIN_VARIANT
(
decl1
)
=
decl1
;
fntype
=
TREE_TYPE
(
decl1
);
if
(
DECL_THIS_INLINE
(
decl1
)
&&
!
DECL_INTERFACE_KNOWN
(
decl1
))
DECL_DEFER_OUTPUT
(
decl1
)
=
1
;
else
{
DECL_INTERFACE_KNOWN
(
decl1
)
=
1
;
if
(
DECL_C_STATIC
(
decl1
))
TREE_PUBLIC
(
decl1
)
=
0
;
}
}
else
current_function_decl
=
decl1
;
if
(
DECL_THIS_INLINE
(
decl1
)
&&
!
DECL_INTERFACE_KNOWN
(
decl1
))
DECL_DEFER_OUTPUT
(
decl1
)
=
1
;
else
DECL_INTERFACE_KNOWN
(
decl1
)
=
1
;
if
(
ctype
!=
NULL_TREE
&&
DECL_STATIC_FUNCTION_P
(
decl1
))
{
...
...
gcc/cp/method.c
View file @
878cd289
...
...
@@ -1567,8 +1567,7 @@ hack_identifier (value, name, yychar)
my_friendly_assert
(
TREE_CODE
(
value
)
==
VAR_DECL
||
TREE_CODE
(
value
)
==
PARM_DECL
||
TREE_CODE
(
value
)
==
RESULT_DECL
,
252
);
if
(
DECL_REFERENCE_SLOT
(
value
))
return
DECL_REFERENCE_SLOT
(
value
);
return
convert_from_reference
(
value
);
}
return
value
;
}
...
...
gcc/cp/tree.c
View file @
878cd289
...
...
@@ -1614,15 +1614,21 @@ build_exception_variant (ctype, type, raises)
Assuming T is a node build bottom-up, make it all exist on
permanent obstack, if it is not permanent already. */
static
tree
make_deep_copy
(
t
)
tree
mapcar
(
t
,
func
)
tree
t
;
tree
(
*
func
)();
{
enum
tree_code
code
;
tree
tmp
;
if
(
t
==
NULL_TREE
||
TREE_PERMANENT
(
t
)
)
if
(
t
==
NULL_TREE
)
return
t
;
if
(
tmp
=
func
(
t
),
tmp
!=
NULL_TREE
)
return
tmp
;
switch
(
code
=
TREE_CODE
(
t
))
{
case
ERROR_MARK
:
...
...
@@ -1637,10 +1643,10 @@ make_deep_copy (t)
{
tree
chain
=
TREE_CHAIN
(
t
);
t
=
copy_node
(
t
);
TREE_CHAIN
(
t
)
=
ma
ke_deep_copy
(
chain
);
TREE_TYPE
(
t
)
=
ma
ke_deep_copy
(
TREE_TYPE
(
t
)
);
DECL_INITIAL
(
t
)
=
ma
ke_deep_copy
(
DECL_INITIAL
(
t
)
);
DECL_SIZE
(
t
)
=
ma
ke_deep_copy
(
DECL_SIZE
(
t
)
);
TREE_CHAIN
(
t
)
=
ma
pcar
(
chain
,
func
);
TREE_TYPE
(
t
)
=
ma
pcar
(
TREE_TYPE
(
t
),
func
);
DECL_INITIAL
(
t
)
=
ma
pcar
(
DECL_INITIAL
(
t
),
func
);
DECL_SIZE
(
t
)
=
ma
pcar
(
DECL_SIZE
(
t
),
func
);
return
t
;
}
...
...
@@ -1648,9 +1654,9 @@ make_deep_copy (t)
{
tree
chain
=
TREE_CHAIN
(
t
);
t
=
copy_node
(
t
);
TREE_PURPOSE
(
t
)
=
ma
ke_deep_copy
(
TREE_PURPOSE
(
t
)
);
TREE_VALUE
(
t
)
=
ma
ke_deep_copy
(
TREE_VALUE
(
t
)
);
TREE_CHAIN
(
t
)
=
ma
ke_deep_copy
(
chain
);
TREE_PURPOSE
(
t
)
=
ma
pcar
(
TREE_PURPOSE
(
t
),
func
);
TREE_VALUE
(
t
)
=
ma
pcar
(
TREE_VALUE
(
t
),
func
);
TREE_CHAIN
(
t
)
=
ma
pcar
(
chain
,
func
);
return
t
;
}
...
...
@@ -1660,7 +1666,7 @@ make_deep_copy (t)
t
=
copy_node
(
t
);
while
(
len
--
)
TREE_VEC_ELT
(
t
,
len
)
=
ma
ke_deep_copy
(
TREE_VEC_ELT
(
t
,
len
)
);
TREE_VEC_ELT
(
t
,
len
)
=
ma
pcar
(
TREE_VEC_ELT
(
t
,
len
),
func
);
return
t
;
}
...
...
@@ -1673,14 +1679,14 @@ make_deep_copy (t)
case
TARGET_EXPR
:
case
NEW_EXPR
:
t
=
copy_node
(
t
);
TREE_OPERAND
(
t
,
0
)
=
ma
ke_deep_copy
(
TREE_OPERAND
(
t
,
0
)
);
TREE_OPERAND
(
t
,
1
)
=
ma
ke_deep_copy
(
TREE_OPERAND
(
t
,
1
)
);
TREE_OPERAND
(
t
,
2
)
=
ma
ke_deep_copy
(
TREE_OPERAND
(
t
,
2
)
);
TREE_OPERAND
(
t
,
0
)
=
ma
pcar
(
TREE_OPERAND
(
t
,
0
),
func
);
TREE_OPERAND
(
t
,
1
)
=
ma
pcar
(
TREE_OPERAND
(
t
,
1
),
func
);
TREE_OPERAND
(
t
,
2
)
=
ma
pcar
(
TREE_OPERAND
(
t
,
2
),
func
);
return
t
;
case
SAVE_EXPR
:
t
=
copy_node
(
t
);
TREE_OPERAND
(
t
,
0
)
=
ma
ke_deep_copy
(
TREE_OPERAND
(
t
,
0
)
);
TREE_OPERAND
(
t
,
0
)
=
ma
pcar
(
TREE_OPERAND
(
t
,
0
),
func
);
return
t
;
case
MODIFY_EXPR
:
...
...
@@ -1718,8 +1724,8 @@ make_deep_copy (t)
case
POSTINCREMENT_EXPR
:
case
CALL_EXPR
:
t
=
copy_node
(
t
);
TREE_OPERAND
(
t
,
0
)
=
ma
ke_deep_copy
(
TREE_OPERAND
(
t
,
0
)
);
TREE_OPERAND
(
t
,
1
)
=
ma
ke_deep_copy
(
TREE_OPERAND
(
t
,
1
)
);
TREE_OPERAND
(
t
,
0
)
=
ma
pcar
(
TREE_OPERAND
(
t
,
0
),
func
);
TREE_OPERAND
(
t
,
1
)
=
ma
pcar
(
TREE_OPERAND
(
t
,
1
),
func
);
return
t
;
case
CONVERT_EXPR
:
...
...
@@ -1731,36 +1737,36 @@ make_deep_copy (t)
case
NOP_EXPR
:
case
COMPONENT_REF
:
t
=
copy_node
(
t
);
TREE_OPERAND
(
t
,
0
)
=
ma
ke_deep_copy
(
TREE_OPERAND
(
t
,
0
)
);
TREE_OPERAND
(
t
,
0
)
=
ma
pcar
(
TREE_OPERAND
(
t
,
0
),
func
);
return
t
;
case
POINTER_TYPE
:
return
build_pointer_type
(
ma
ke_deep_copy
(
TREE_TYPE
(
t
)
));
return
build_pointer_type
(
ma
pcar
(
TREE_TYPE
(
t
),
func
));
case
REFERENCE_TYPE
:
return
build_reference_type
(
ma
ke_deep_copy
(
TREE_TYPE
(
t
)
));
return
build_reference_type
(
ma
pcar
(
TREE_TYPE
(
t
),
func
));
case
FUNCTION_TYPE
:
return
build_function_type
(
ma
ke_deep_copy
(
TREE_TYPE
(
t
)
),
ma
ke_deep_copy
(
TYPE_ARG_TYPES
(
t
)
));
return
build_function_type
(
ma
pcar
(
TREE_TYPE
(
t
),
func
),
ma
pcar
(
TYPE_ARG_TYPES
(
t
),
func
));
case
ARRAY_TYPE
:
return
build_array_type
(
ma
ke_deep_copy
(
TREE_TYPE
(
t
)
),
ma
ke_deep_copy
(
TYPE_DOMAIN
(
t
)
));
return
build_array_type
(
ma
pcar
(
TREE_TYPE
(
t
),
func
),
ma
pcar
(
TYPE_DOMAIN
(
t
),
func
));
case
INTEGER_TYPE
:
return
build_index_type
(
ma
ke_deep_copy
(
TYPE_MAX_VALUE
(
t
)
));
return
build_index_type
(
ma
pcar
(
TYPE_MAX_VALUE
(
t
),
func
));
case
OFFSET_TYPE
:
return
build_offset_type
(
ma
ke_deep_copy
(
TYPE_OFFSET_BASETYPE
(
t
)
),
ma
ke_deep_copy
(
TREE_TYPE
(
t
)
));
return
build_offset_type
(
ma
pcar
(
TYPE_OFFSET_BASETYPE
(
t
),
func
),
ma
pcar
(
TREE_TYPE
(
t
),
func
));
case
METHOD_TYPE
:
return
build_method_type
(
ma
ke_deep_copy
(
TYPE_METHOD_BASETYPE
(
t
)
),
(
ma
pcar
(
TYPE_METHOD_BASETYPE
(
t
),
func
),
build_function_type
(
ma
ke_deep_copy
(
TREE_TYPE
(
t
)
),
ma
ke_deep_copy
(
TREE_CHAIN
(
TYPE_ARG_TYPES
(
t
))
)));
(
ma
pcar
(
TREE_TYPE
(
t
),
func
),
ma
pcar
(
TREE_CHAIN
(
TYPE_ARG_TYPES
(
t
)),
func
)));
case
RECORD_TYPE
:
if
(
TYPE_PTRMEMFUNC_P
(
t
))
return
build_ptrmemfunc_type
(
ma
ke_deep_copy
(
TYPE_PTRMEMFUNC_FN_TYPE
(
t
)
));
(
ma
pcar
(
TYPE_PTRMEMFUNC_FN_TYPE
(
t
),
func
));
/* else fall through */
/* This list is incomplete, but should suffice for now.
...
...
@@ -1776,6 +1782,15 @@ make_deep_copy (t)
return
NULL_TREE
;
}
static
tree
perm_manip
(
t
)
tree
t
;
{
if
(
TREE_PERMANENT
(
t
))
return
t
;
return
NULL_TREE
;
}
/* Assuming T is a node built bottom-up, make it all exist on
permanent obstack, if it is not permanent already. */
tree
...
...
@@ -1793,7 +1808,7 @@ copy_to_permanent (t)
current_obstack
=
saveable_obstack
;
resume
=
suspend_momentary
();
t
=
ma
ke_deep_copy
(
t
);
t
=
ma
pcar
(
t
,
perm_manip
);
resume_momentary
(
resume
);
current_obstack
=
ambient_obstack
;
...
...
@@ -1866,3 +1881,24 @@ array_type_nelts_total (type)
}
return
sz
;
}
static
tree
bot_manip
(
t
)
tree
t
;
{
if
(
TREE_CODE
(
t
)
!=
TREE_LIST
&&
!
TREE_SIDE_EFFECTS
(
t
))
return
t
;
else
if
(
TREE_CODE
(
t
)
==
TARGET_EXPR
)
return
build_cplus_new
(
TREE_TYPE
(
t
),
break_out_target_exprs
(
TREE_OPERAND
(
t
,
1
)),
0
);
return
NULL_TREE
;
}
/* Actually, we'll just clean out the target exprs for the moment. */
tree
break_out_target_exprs
(
t
)
tree
t
;
{
return
mapcar
(
t
,
bot_manip
);
}
gcc/cp/typeck.c
View file @
878cd289
...
...
@@ -2453,7 +2453,10 @@ build_function_call_real (function, params, require_complete, flags)
params
,
fndecl
,
0
);
if
(
coerced_params
==
error_mark_node
)
return
error_mark_node
;
if
(
flags
&
LOOKUP_SPECULATIVELY
)
return
NULL_TREE
;
else
return
error_mark_node
;
/* Check for errors in format strings. */
...
...
@@ -2689,6 +2692,10 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
parmval
=
default_conversion
(
parmval
);
#endif
}
if
(
parmval
==
error_mark_node
)
return
error_mark_node
;
result
=
tree_cons
(
NULL_TREE
,
parmval
,
result
);
}
else
...
...
@@ -2736,7 +2743,7 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
for
(;
typetail
!=
void_list_node
;
++
i
)
{
tree
type
=
TREE_VALUE
(
typetail
);
tree
val
=
TREE_PURPOSE
(
typetail
);
tree
val
=
break_out_target_exprs
(
TREE_PURPOSE
(
typetail
)
);
tree
parmval
;
if
(
val
==
NULL_TREE
)
...
...
@@ -2763,6 +2770,9 @@ convert_arguments (return_loc, typelist, values, fndecl, flags)
#endif
}
if
(
parmval
==
error_mark_node
)
return
error_mark_node
;
if
(
flag_gc
&&
type_needs_gc_entry
(
TREE_TYPE
(
parmval
))
&&
!
value_safe_from_gc
(
NULL_TREE
,
parmval
))
...
...
@@ -6526,7 +6536,7 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
||
(
coder
==
ENUMERAL_TYPE
&&
(
INTEGRAL_CODE_P
(
codel
)
||
codel
==
REAL_TYPE
)))
{
return
cp_convert
(
type
,
rhs
,
CONV_IMPLICIT
,
0
);
return
cp_convert
(
type
,
rhs
,
CONV_IMPLICIT
,
LOOKUP_NORMAL
);
}
/* Conversions among pointers */
else
if
(
codel
==
POINTER_TYPE
...
...
@@ -6898,7 +6908,9 @@ convert_for_assignment (type, rhs, errtype, fndecl, parmnum)
latter (X(X&)).
If using constructor make sure no conversion operator exists, if one does
exist, an ambiguity exists. */
exist, an ambiguity exists.
If flags doesn't include LOOKUP_COMPLAIN, don't complain about anything. */
tree
convert_for_initialization
(
exp
,
type
,
rhs
,
flags
,
errtype
,
fndecl
,
parmnum
)
tree
exp
,
type
,
rhs
;
...
...
@@ -7069,7 +7081,7 @@ convert_for_initialization (exp, type, rhs, flags, errtype, fndecl, parmnum)
return
rhs
;
}
return
c
onvert
(
type
,
rh
s
);
return
c
p_convert
(
type
,
rhs
,
CONV_OLD_CONVERT
,
flag
s
);
}
if
(
type
==
TREE_TYPE
(
rhs
))
...
...
gcc/cp/typeck2.c
View file @
878cd289
...
...
@@ -537,8 +537,11 @@ store_init_value (decl, init)
if
(
TREE_CODE
(
type
)
==
ERROR_MARK
)
return
NULL_TREE
;
#if 0
/* This breaks arrays, and should not have any effect for other decls. */
/* Take care of C++ business up here. */
type = TYPE_MAIN_VARIANT (type);
#endif
if
(
IS_AGGR_TYPE
(
type
))
{
...
...
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