]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/toplev.c
(poplevel): Store into BLOCK iff it is non-null.
[gcc.git] / gcc / toplev.c
index 9dd4403a2f02aab71e4eb5d65775aea0e752f269..55b1b97718f039913724a63a91478eeed01a690e 100644 (file)
@@ -77,7 +77,9 @@ VMS_fopen (fname, type)
 
 extern int rtx_equal_function_value_matters;
 
+#if ! (defined (VMS) || defined (OS2))
 extern char **environ;
+#endif
 extern char *version_string, *language_string;
 
 extern void init_lex ();
@@ -1703,7 +1705,7 @@ compile_file (name)
            && DECL_INITIAL (decl) != 0
            && (TREE_ADDRESSABLE (decl)
                || TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (decl)))
-           && ! TREE_EXTERNAL (decl))
+           && ! DECL_EXTERNAL (decl))
          output_inline_function (decl);
 
        /* Warn about any function
@@ -1716,7 +1718,7 @@ compile_file (name)
             || (DECL_NAME (decl) && TREE_USED (DECL_NAME (decl))))
            && TREE_CODE (decl) == FUNCTION_DECL
            && DECL_INITIAL (decl) == 0
-           && TREE_EXTERNAL (decl)
+           && DECL_EXTERNAL (decl)
            && ! TREE_PUBLIC (decl))
          warning_with_decl (decl, "`%s' declared `static' but never defined");
        /* Warn about static fns or vars defined but not used,
@@ -1726,10 +1728,10 @@ compile_file (name)
            && (TREE_CODE (decl) == FUNCTION_DECL
                || TREE_CODE (decl) == VAR_DECL)
            && ! DECL_IN_SYSTEM_HEADER (decl)
-           && ! TREE_EXTERNAL (decl)
+           && ! DECL_EXTERNAL (decl)
            && ! TREE_PUBLIC (decl)
            && ! TREE_USED (decl)
-           && ! TREE_INLINE (decl)
+           && ! DECL_INLINE (decl)
            /* The TREE_USED bit for file-scope decls
               is kept in the identifier, to handle multiple
               external decls in different scopes.  */
@@ -1912,7 +1914,7 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
 
   /* Forward declarations for nested functions are not "external",
      but we need to treat them as if they were.  */
-  if (TREE_STATIC (decl) || TREE_EXTERNAL (decl)
+  if (TREE_STATIC (decl) || DECL_EXTERNAL (decl)
       || TREE_CODE (decl) == FUNCTION_DECL)
     TIMEVAR (varconst_time,
             {
@@ -1931,7 +1933,7 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
                            || DECL_IGNORED_P (decl))))
                   assemble_variable (decl, top_level, at_end);
             });
-  else if (TREE_REGDECL (decl) && asmspec != 0)
+  else if (DECL_REGISTER (decl) && asmspec != 0)
     {
       if (decode_reg_name (asmspec) >= 0)
        {
@@ -1987,6 +1989,8 @@ rest_of_compilation (decl)
      to be restored after we finish compiling the function
      (for use when compiling inline calls to this function).  */
   tree saved_block_tree = 0;
+  /* Likewise, for DECL_ARGUMENTS.  */
+  tree saved_arguments = 0;
   int failure = 0;
 
   /* If we are reconsidering an inline function
@@ -1994,7 +1998,7 @@ rest_of_compilation (decl)
 
   if (DECL_SAVED_INSNS (decl) == 0)
     {
-      int specd = TREE_INLINE (decl);
+      int specd = DECL_INLINE (decl);
       char *lose;
 
       /* If requested, consider whether to make this function inline.  */
@@ -2006,10 +2010,10 @@ rest_of_compilation (decl)
                     {
                       if (warn_inline && specd)
                         warning_with_decl (decl, lose);
-                      TREE_INLINE (decl) = 0;
+                      DECL_INLINE (decl) = 0;
                     }
                   else
-                    TREE_INLINE (decl) = 1;
+                    DECL_INLINE (decl) = 1;
                 });
 
       insns = get_insns ();
@@ -2032,20 +2036,44 @@ rest_of_compilation (decl)
         finish_compilation will call rest_of_compilation again
         for those functions that need to be output.  */
 
-      if (TREE_INLINE (decl)
+      if (DECL_INLINE (decl)
          && ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
               && ! flag_keep_inline_functions)
-             || TREE_EXTERNAL (decl)))
+             || DECL_EXTERNAL (decl)))
        {
+#ifdef DWARF_DEBUGGING_INFO
+         /* Generate the DWARF info for the "abstract" instance
+            of a function which we may later generate inlined and/or
+            out-of-line instances of.  */
+         if (write_symbols == DWARF_DEBUG)
+           {
+             set_decl_abstract_flags (decl, 1);
+             TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
+             set_decl_abstract_flags (decl, 0);
+           }
+#endif
          TIMEVAR (integration_time, save_for_inline_nocopy (decl));
          goto exit_rest_of_compilation;
        }
 
-      /* If we have to compile the function now, save its rtl
+      /* If we have to compile the function now, save its rtl and subdecls
         so that its compilation will not affect what others get.  */
-      if (TREE_INLINE (decl))
+      if (DECL_INLINE (decl))
        {
+#ifdef DWARF_DEBUGGING_INFO
+         /* Generate the DWARF info for the "abstract" instance of
+            a function which we will generate an out-of-line instance
+            of almost immediately (and which we may also later generate
+            various inlined instances of).  */
+         if (write_symbols == DWARF_DEBUG)
+           {
+             set_decl_abstract_flags (decl, 1);
+             TIMEVAR (symout_time, dwarfout_file_scope_decl (decl, 0));
+             set_decl_abstract_flags (decl, 0);
+           }
+#endif
          saved_block_tree = DECL_INITIAL (decl);
+         saved_arguments = DECL_ARGUMENTS (decl);
          TIMEVAR (integration_time, save_for_inline_copying (decl));
        }
     }
@@ -2523,12 +2551,15 @@ rest_of_compilation (decl)
     sdbout_types (NULL_TREE);
 #endif
 
-  /* Put back the tree of subblocks from before we copied it.
+  /* Put back the tree of subblocks and list of arguments
+     from before we copied them.
      Code generation and the output of debugging info may have modified
      the copy, but the original is unchanged.  */
 
   if (saved_block_tree != 0)
     DECL_INITIAL (decl) = saved_block_tree;
+  if (saved_arguments != 0)
+    DECL_ARGUMENTS (decl) = saved_arguments;
 
   reload_completed = 0;
 
@@ -2904,8 +2935,8 @@ main (argc, argv, envp)
              /* If more than one debugging type is supported,
                 you must define PREFERRED_DEBUGGING_TYPE
                 to choose a format in a system-dependent way.  */
-#if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) \
-        + defined (DWARF_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO))
+             /* This is one long line cause VAXC can't handle a \-newline.  */
+#if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO))
 #ifdef PREFERRED_DEBUGGING_TYPE
              if (!strncmp (str, "ggdb", len))
                write_symbols = PREFERRED_DEBUGGING_TYPE;
@@ -3097,7 +3128,7 @@ You Lose!  You must define PREFERRED_DEBUGGING_TYPE!
       char *lim = (char *) sbrk (0);
 
       fprintf (stderr, "Data size %d.\n",
-              (int) lim - (int) &environ);
+              lim - (char *) &environ);
       fflush (stderr);
 
 #ifdef USG
This page took 0.034674 seconds and 5 git commands to generate.