]> gcc.gnu.org Git - gcc.git/commitdiff
86th Cygnus<->FSF quick merge
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 2 May 1996 16:31:04 +0000 (16:31 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Thu, 2 May 1996 16:31:04 +0000 (16:31 +0000)
From-SVN: r11914

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/cp/lex.c
gcc/cp/method.c

index 9d9a755a9a2233ca6ca9a0ae3d3d7c035672c010..4c00b1e87b9aac1c209559aa5603a60cc52142d4 100644 (file)
@@ -1,3 +1,20 @@
+Wed May  1 11:26:52 1996  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl2.c (finish_file): Also use sentries for vars with
+       DECL_ONE_ONLY or DECL_WEAK set (should any such happen to be
+       created).
+
+       * lex.c (handle_cp_pragma): Disable #pragma
+       interface/implementation if SUPPORTS_ONE_ONLY > 1.
+
+Tue Apr 30 11:25:46 1996  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * method.c (emit_thunk): Wrap default case in
+       temporary/permanent_allocation.
+
+       * method.c (make_thunk): Use DECL_ONE_ONLY.
+       (emit_thunk): Call assemble_end_function.
+
 Mon Apr 29 15:38:29 1996  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl2.c (import_export_vtable): Use DECL_ONE_ONLY.
index cdfcfa084d259d9079f5455fe8801e765ecc7020..49011d67b77199c21c238a7f9e4210d5e9a881fa 100644 (file)
@@ -3008,9 +3008,15 @@ finish_file ()
       if (TYPE_NEEDS_DESTRUCTOR (type) && ! TREE_STATIC (vars)
          && ! DECL_EXTERNAL (decl))
        {
+         int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
+#ifdef DECL_ONE_ONLY
+                                               || DECL_ONE_ONLY (decl)
+#endif
+                                               || DECL_WEAK (decl)));
+
          temp = build_cleanup (decl);
 
-         if (DECL_COMMON (decl) && TREE_PUBLIC (decl))
+         if (protect)
            {
              tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl));
              sentry = build_unary_op (PREDECREMENT_EXPR, sentry, 0);
@@ -3020,7 +3026,7 @@ finish_file ()
 
          expand_expr_stmt (temp);
 
-         if (DECL_COMMON (decl) && TREE_PUBLIC (decl))
+         if (protect)
            expand_end_cond ();
        }
     }
@@ -3083,6 +3089,12 @@ finish_file ()
 
          if (TREE_CODE (decl) == VAR_DECL)
            {
+         int protect = (TREE_PUBLIC (decl) && (DECL_COMMON (decl)
+#ifdef DECL_ONE_ONLY
+                                               || DECL_ONE_ONLY (decl)
+#endif
+                                               || DECL_WEAK (decl)));
+
              /* Set these global variables so that GDB at least puts
                 us near the declaration which required the initialization.  */
              input_filename = DECL_SOURCE_FILE (decl);
@@ -3094,7 +3106,7 @@ finish_file ()
              DECL_CLASS_CONTEXT (current_function_decl) = DECL_CONTEXT (decl);
              DECL_STATIC_FUNCTION_P (current_function_decl) = 1;
 
-             if (DECL_COMMON (decl) && TREE_PUBLIC (decl))
+             if (protect)
                {
                  tree sentry = get_sentry (DECL_ASSEMBLER_NAME (decl));
                  sentry = build_unary_op (PREINCREMENT_EXPR, sentry, 0);
@@ -3116,7 +3128,7 @@ finish_file ()
              else
                expand_assignment (decl, init, 0, 0);
 
-             if (DECL_COMMON (decl) && TREE_PUBLIC (decl))
+             if (protect)
                expand_end_cond ();
 
              DECL_CLASS_CONTEXT (current_function_decl) = NULL_TREE;
index fb0ebbc72792e82450f4b27688413649ab62ca02..0b46990f60db6b148dbcbb4c95722a15a2fef199 100644 (file)
@@ -4449,6 +4449,11 @@ handle_cp_pragma (pname)
            }
          main_filename = TREE_STRING_POINTER (yylval.ttype);
        }
+
+#ifdef SUPPORTS_ONE_ONLY
+      if (SUPPORTS_ONE_ONLY > 1)
+       return 1;
+#endif
       
       while (token != END_OF_LINE)
        {
@@ -4518,6 +4523,11 @@ handle_cp_pragma (pname)
          token = real_yylex ();
        }
 
+#ifdef SUPPORTS_ONE_ONLY
+      if (SUPPORTS_ONE_ONLY > 1)
+       return 1;
+#endif
+
       if (write_virtuals == 3)
        {
          struct impl_files *ifiles = impl_file_chain;
index d31ea15479bea9973507e2636477c75de8ac343a..5e1793bcc050e1fed645d302659192b72a61508a 100644 (file)
@@ -39,6 +39,10 @@ Boston, MA 02111-1307, USA.  */
 #include "hard-reg-set.h"
 #include "flags.h"
 
+#ifndef SUPPORTS_ONE_ONLY
+#define SUPPORTS_ONE_ONLY 0
+#endif
+
 /* TREE_LIST of the current inline functions that need to be
    processed.  */
 struct pending_inline *pending_inlines;
@@ -1831,7 +1835,15 @@ make_thunk (function, delta)
       DECL_INITIAL (thunk) = function;
       THUNK_DELTA (thunk) = delta;
       DECL_EXTERNAL (thunk) = 1;
-      TREE_PUBLIC (thunk) = 0;
+#ifdef DECL_ONE_ONLY
+      if (SUPPORTS_ONE_ONLY)
+       {
+         DECL_ONE_ONLY (thunk) = 1;
+         TREE_PUBLIC (thunk) = 1;
+       }
+      else
+#endif
+       TREE_PUBLIC (thunk) = 0;
       /* So that finish_file can write out any thunks that need to be: */
       pushdecl_top_level (thunk);
     }
@@ -1868,20 +1880,24 @@ emit_thunk (thunk_fndecl)
 
   TREE_ASM_WRITTEN (thunk_fndecl) = 1;
 
+  TREE_ADDRESSABLE (function) = 1;
+  mark_used (function);
+
   decl_printable_name = thunk_printable_name;
   if (current_function_decl)
     abort ();
   current_function_decl = thunk_fndecl;
-  TREE_ADDRESSABLE (function) = 1;
-  mark_used (function);
 #ifdef ASM_OUTPUT_MI_THUNK
   assemble_start_function (thunk_fndecl, fnname);
   ASM_OUTPUT_MI_THUNK (asm_out_file, thunk_fndecl, delta, function);
+  assemble_end_function (thunk_fndecl, fnname);
 #else
   init_function_start (thunk_fndecl, input_filename, lineno);
   pushlevel (0);
   expand_start_bindings (1);
 
+  temporary_allocation ();
+
   /* Start updating where the next arg would go.  */
   INIT_CUMULATIVE_ARGS (args_so_far, TREE_TYPE (function), NULL_RTX, 0);
   stack_args_size.constant = 0;
@@ -2053,10 +2069,10 @@ emit_thunk (thunk_fndecl)
 
   /* Cancel the effect of rtl_in_current_obstack.  */
 
-  resume_temporary_allocation ();
+  permanent_allocation (1);
+#endif /* ASM_OUTPUT_MI_THUNK */
 
   decl_printable_name = save_decl_printable_name;
-#endif /* ASM_OUTPUT_MI_THUNK */
   current_function_decl = 0;
 }
 \f
This page took 0.104007 seconds and 5 git commands to generate.