diff options
author | merrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-10-27 01:22:58 +0000 |
---|---|---|
committer | merrill <merrill@138bc75d-0d04-0410-961f-82ee72b054a4> | 1994-10-27 01:22:58 +0000 |
commit | 0d77f64c7888be6ec16bcc75e4b3685f4034a074 (patch) | |
tree | 4e5b97d302910a34e3d6be43511996ecb3e9d0f7 /gcc/cp | |
parent | d625a8d9eae96f9c45e7541ca8929df1b5cade06 (diff) | |
download | gcc-0d77f64c7888be6ec16bcc75e4b3685f4034a074.tar.gz |
*** empty log message ***
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@8347 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 24 | ||||
-rw-r--r-- | gcc/cp/decl.c | 4 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 4 | ||||
-rw-r--r-- | gcc/cp/expr.c | 7 | ||||
-rw-r--r-- | gcc/cp/search.c | 4 | ||||
-rw-r--r-- | gcc/cp/tree.c | 4 |
6 files changed, 42 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0da50f7c69c..84c32316cc9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index d4e04f05f51..048ce5eb0e2 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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); diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index cc0ab50ff64..a50b7bce129 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -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} }; diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c index c2213d5f661..3b4f65d1b81 100644 --- a/gcc/cp/expr.c +++ b/gcc/cp/expr.c @@ -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, diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 967b00a4b66..7f6af726898 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -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; diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index f598fe0eefd..5db4a66e308 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -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; |