Commit eae89e04 by Jason Merrill Committed by Jason Merrill

*** empty log message ***

From-SVN: r8347
parent 1c6c2b05
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> Mon Oct 17 15:56:11 1994 Mike Stump <mrs@cygnus.com>
* except.c (expand_start_catch_block): Make sure the false label * except.c (expand_start_catch_block): Make sure the false label
......
...@@ -4564,7 +4564,6 @@ init_decl_processing () ...@@ -4564,7 +4564,6 @@ init_decl_processing ()
Declare _exit just to mark it as volatile. */ Declare _exit just to mark it as volatile. */
if (! flag_no_builtin && !flag_no_nonansi_builtin) if (! flag_no_builtin && !flag_no_nonansi_builtin)
{ {
#if 0 /* Why is this disabled? (jason 8/9/94) */
temp = builtin_function ("alloca", temp = builtin_function ("alloca",
build_function_type (ptr_type_node, build_function_type (ptr_type_node,
tree_cons (NULL_TREE, tree_cons (NULL_TREE,
...@@ -4573,7 +4572,6 @@ init_decl_processing () ...@@ -4573,7 +4572,6 @@ init_decl_processing ()
BUILT_IN_ALLOCA, NULL_PTR); BUILT_IN_ALLOCA, NULL_PTR);
/* Suppress error if redefined as a non-function. */ /* Suppress error if redefined as a non-function. */
DECL_BUILT_IN_NONANSI (temp) = 1; DECL_BUILT_IN_NONANSI (temp) = 1;
#endif
temp = builtin_function ("ffs", int_ftype_int, BUILT_IN_FFS, NULL_PTR); temp = builtin_function ("ffs", int_ftype_int, BUILT_IN_FFS, NULL_PTR);
/* Suppress error if redefined as a non-function. */ /* Suppress error if redefined as a non-function. */
DECL_BUILT_IN_NONANSI (temp) = 1; DECL_BUILT_IN_NONANSI (temp) = 1;
...@@ -4987,7 +4985,7 @@ init_decl_processing () ...@@ -4987,7 +4985,7 @@ init_decl_processing ()
NOT_BUILT_IN); NOT_BUILT_IN);
abort_fndecl abort_fndecl
= define_function ("abort", = define_function ("__pure_virtual",
build_function_type (void_type_node, void_list_node), build_function_type (void_type_node, void_list_node),
NOT_BUILT_IN, 0, 0); NOT_BUILT_IN, 0, 0);
......
...@@ -331,6 +331,9 @@ int flag_huge_objects; ...@@ -331,6 +331,9 @@ int flag_huge_objects;
definitions. */ definitions. */
int flag_conserve_space; int flag_conserve_space;
/* Nonzero if we want to obey access control semantics. */
int flag_access_control = 1;
/* Table of language-dependent -f options. /* Table of language-dependent -f options.
STRING is the option name. VARIABLE is the address of the variable. STRING is the option name. VARIABLE is the address of the variable.
ON_VALUE is the value to store in 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[] = ...@@ -372,6 +375,7 @@ static struct { char *string; int *variable; int on_value;} lang_f_options[] =
{"conserve-space", &flag_conserve_space, 1}, {"conserve-space", &flag_conserve_space, 1},
{"vtable-thunks", &flag_vtable_thunks, 1}, {"vtable-thunks", &flag_vtable_thunks, 1},
{"short-temps", &flag_short_temps, 1}, {"short-temps", &flag_short_temps, 1},
{"access-control", &flag_access_control, 1},
{"nonansi-builtins", &flag_no_nonansi_builtin, 0} {"nonansi-builtins", &flag_no_nonansi_builtin, 0}
}; };
......
...@@ -148,9 +148,16 @@ cplus_expand_expr (exp, target, tmode, modifier) ...@@ -148,9 +148,16 @@ cplus_expand_expr (exp, target, tmode, modifier)
{ {
if (pcc_struct_return) 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 init = build (RTL_EXPR, type, 0, return_target);
TREE_ADDRESSABLE (init) = 1; TREE_ADDRESSABLE (init) = 1;
flag_access_control = 0;
expand_aggr_init (slot, init, 0); expand_aggr_init (slot, init, 0);
flag_access_control = old_ac;
if (TYPE_NEEDS_DESTRUCTOR (type)) if (TYPE_NEEDS_DESTRUCTOR (type))
{ {
init = build (RTL_EXPR, build_reference_type (type), 0, init = build (RTL_EXPR, build_reference_type (type), 0,
......
...@@ -768,6 +768,7 @@ compute_access (basetype_path, field) ...@@ -768,6 +768,7 @@ compute_access (basetype_path, field)
tree types; tree types;
tree context; tree context;
int protected_ok, via_protected; int protected_ok, via_protected;
extern int flag_access_control;
#if 1 #if 1
/* Replaces static decl above. */ /* Replaces static decl above. */
tree previous_scope; tree previous_scope;
...@@ -776,6 +777,9 @@ compute_access (basetype_path, field) ...@@ -776,6 +777,9 @@ compute_access (basetype_path, field)
((TREE_CODE (field) == FUNCTION_DECL && DECL_STATIC_FUNCTION_P (field)) ((TREE_CODE (field) == FUNCTION_DECL && DECL_STATIC_FUNCTION_P (field))
|| (TREE_CODE (field) != FUNCTION_DECL && TREE_STATIC (field))); || (TREE_CODE (field) != FUNCTION_DECL && TREE_STATIC (field)));
if (! flag_access_control)
return access_public;
/* The field lives in the current class. */ /* The field lives in the current class. */
if (BINFO_TYPE (basetype_path) == current_class_type) if (BINFO_TYPE (basetype_path) == current_class_type)
return access_public; return access_public;
......
...@@ -1765,7 +1765,7 @@ tree ...@@ -1765,7 +1765,7 @@ tree
array_type_nelts_top (type) array_type_nelts_top (type)
tree type; tree type;
{ {
return fold (build (PLUS_EXPR, integer_type_node, return fold (build (PLUS_EXPR, sizetype,
array_type_nelts (type), array_type_nelts (type),
integer_one_node)); integer_one_node));
} }
...@@ -1783,7 +1783,7 @@ array_type_nelts_total (type) ...@@ -1783,7 +1783,7 @@ array_type_nelts_total (type)
while (TREE_CODE (type) == ARRAY_TYPE) while (TREE_CODE (type) == ARRAY_TYPE)
{ {
tree n = array_type_nelts_top (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); type = TREE_TYPE (type);
} }
return sz; return sz;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment