*** empty log message ***

From-SVN: r8347
This commit is contained in:
Jason Merrill 1994-10-27 01:22:58 +00:00 committed by Jason Merrill
parent 1c6c2b05c7
commit eae89e0400
6 changed files with 42 additions and 5 deletions

View File

@ -1,3 +1,27 @@
Sun Oct 23 13:19:55 1994 Jason Merrill (jason@phydeaux.cygnus.com)
* decl2.c: Declare flag_access_control.
(struct lang_f_options): Add access-control.
* expr.c (cplus_expand_expr, NEW_EXPR): Unset flag_access_control
for the call to expand_aggr_init to copy the object out of the
pcc_struct_return slot.
* search.c (compute_access): if (!flag_access_control) return
access_public.
Fri Oct 21 00:32:54 1994 Jason Merrill (jason@phydeaux.cygnus.com)
* decl.c (init_decl_processing): Use __pure_virtual for abort_fndecl
instead of abort, since the OSF/1 dynamic linker doesn't like to see
relocation entries for abort.
* tree.c (array_type_nelts_total): Use sizetype, not
integer_type_node.
(array_type_nelts_top): Ditto.
Mon Oct 17 18:03:15 1994 Jason Merrill (jason@phydeaux.cygnus.com)
* decl.c (init_decl_processing): Make alloca a builtin.
Mon Oct 17 15:56:11 1994 Mike Stump <mrs@cygnus.com>
* except.c (expand_start_catch_block): Make sure the false label

View File

@ -4564,7 +4564,6 @@ init_decl_processing ()
Declare _exit just to mark it as volatile. */
if (! flag_no_builtin && !flag_no_nonansi_builtin)
{
#if 0 /* Why is this disabled? (jason 8/9/94) */
temp = builtin_function ("alloca",
build_function_type (ptr_type_node,
tree_cons (NULL_TREE,
@ -4573,7 +4572,6 @@ init_decl_processing ()
BUILT_IN_ALLOCA, NULL_PTR);
/* Suppress error if redefined as a non-function. */
DECL_BUILT_IN_NONANSI (temp) = 1;
#endif
temp = builtin_function ("ffs", int_ftype_int, BUILT_IN_FFS, NULL_PTR);
/* Suppress error if redefined as a non-function. */
DECL_BUILT_IN_NONANSI (temp) = 1;
@ -4987,7 +4985,7 @@ init_decl_processing ()
NOT_BUILT_IN);
abort_fndecl
= define_function ("abort",
= define_function ("__pure_virtual",
build_function_type (void_type_node, void_list_node),
NOT_BUILT_IN, 0, 0);

View File

@ -331,6 +331,9 @@ int flag_huge_objects;
definitions. */
int flag_conserve_space;
/* Nonzero if we want to obey access control semantics. */
int flag_access_control = 1;
/* Table of language-dependent -f options.
STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in VARIABLE
@ -372,6 +375,7 @@ static struct { char *string; int *variable; int on_value;} lang_f_options[] =
{"conserve-space", &flag_conserve_space, 1},
{"vtable-thunks", &flag_vtable_thunks, 1},
{"short-temps", &flag_short_temps, 1},
{"access-control", &flag_access_control, 1},
{"nonansi-builtins", &flag_no_nonansi_builtin, 0}
};

View File

@ -148,9 +148,16 @@ cplus_expand_expr (exp, target, tmode, modifier)
{
if (pcc_struct_return)
{
extern int flag_access_control;
int old_ac = flag_access_control;
tree init = build (RTL_EXPR, type, 0, return_target);
TREE_ADDRESSABLE (init) = 1;
flag_access_control = 0;
expand_aggr_init (slot, init, 0);
flag_access_control = old_ac;
if (TYPE_NEEDS_DESTRUCTOR (type))
{
init = build (RTL_EXPR, build_reference_type (type), 0,

View File

@ -768,6 +768,7 @@ compute_access (basetype_path, field)
tree types;
tree context;
int protected_ok, via_protected;
extern int flag_access_control;
#if 1
/* Replaces static decl above. */
tree previous_scope;
@ -776,6 +777,9 @@ compute_access (basetype_path, field)
((TREE_CODE (field) == FUNCTION_DECL && DECL_STATIC_FUNCTION_P (field))
|| (TREE_CODE (field) != FUNCTION_DECL && TREE_STATIC (field)));
if (! flag_access_control)
return access_public;
/* The field lives in the current class. */
if (BINFO_TYPE (basetype_path) == current_class_type)
return access_public;

View File

@ -1765,7 +1765,7 @@ tree
array_type_nelts_top (type)
tree type;
{
return fold (build (PLUS_EXPR, integer_type_node,
return fold (build (PLUS_EXPR, sizetype,
array_type_nelts (type),
integer_one_node));
}
@ -1783,7 +1783,7 @@ array_type_nelts_total (type)
while (TREE_CODE (type) == ARRAY_TYPE)
{
tree n = array_type_nelts_top (type);
sz = fold (build (MULT_EXPR, integer_type_node, sz, n));
sz = fold (build (MULT_EXPR, sizetype, sz, n));
type = TREE_TYPE (type);
}
return sz;