OSDN Git Service

* c-decl.c (set_block): Set NAMES and BLOCKS from BLOCK.
[pf3gnuchains/gcc-fork.git] / gcc / f / com.c
index 458acd0..d7ff94a 100644 (file)
@@ -1,5 +1,5 @@
 /* com.c -- Implementation File (module.c template V1.0)
-   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001
    Free Software Foundation, Inc.
    Contributed by James Craig Burley.
 
@@ -89,7 +89,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 #include "output.h"  /* Must follow tree.h so TREE_CODE is defined! */
 #include "convert.h"
 #include "ggc.h"
-#include "defaults.h"
 #endif /* FFECOM_targetCURRENT == FFECOM_targetGCC */
 
 #define FFECOM_GCC_INCLUDE 1   /* Enable -I. */
@@ -124,19 +123,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
 # endif
 #endif
 
-#ifndef RLIMIT_STACK
-# include <time.h>
-#else
-# if TIME_WITH_SYS_TIME
-#  include <sys/time.h>
-#  include <time.h>
-# else
-#  if HAVE_SYS_TIME_H
-#   include <sys/time.h>
-#  else
-#   include <time.h>
-#  endif
-# endif
+#ifdef RLIMIT_STACK
 # include <sys/resource.h>
 #endif
 
@@ -180,9 +167,6 @@ static void hack_vms_include_specification ();
 typedef struct { unsigned :16, :16, :16; } vms_ino_t;
 #define ino_t vms_ino_t
 #define INCLUDE_LEN_FUDGE 10   /* leave room for VMS syntax conversion */
-#ifdef __GNUC__
-#define BSTRING                        /* VMS/GCC supplies the bstring routines */
-#endif /* __GNUC__ */
 #endif /* VMS */
 
 #ifndef O_RDONLY
@@ -1840,7 +1824,7 @@ ffecom_build_f2c_string_ (int i, const char *s)
       tmp = &space[0];
 
     for (p = s, q = tmp; *p != '\0'; ++p, ++q)
-      *q = ffesrc_toupper (*p);
+      *q = TOUPPER (*p);
     *q = '\0';
 
     t = build_string (i, tmp);
@@ -6463,7 +6447,7 @@ ffecom_init_zero_ (tree decl)
 
   if (incremental)
     {
-      make_decl_rtl (decl, NULL, TREE_PUBLIC (decl) ? 1 : 0);
+      make_decl_rtl (decl, NULL);
       assemble_variable (decl, TREE_PUBLIC (decl) ? 1 : 0, 0, 1);
     }
 
@@ -7110,6 +7094,7 @@ ffecom_member_phase2_ (ffestorag mst, ffestorag st)
   TREE_STATIC (t) = TREE_STATIC (mt);
   DECL_INITIAL (t) = NULL_TREE;
   TREE_ASM_WRITTEN (t) = 1;
+  TREE_USED (t) = 1;
 
   DECL_RTL (t)
     = gen_rtx (MEM, TYPE_MODE (type),
@@ -11870,7 +11855,7 @@ ffecom_init_0 ()
   /* Set up pointer types.  */
 
   if (ffecom_pointer_kind_ == FFEINFO_basictypeNONE)
-    fatal ("no INTEGER type can hold a pointer on this configuration");
+    fatal_error ("no INTEGER type can hold a pointer on this configuration");
   else if (0 && ffe_is_do_internal_checks ())
     fprintf (stderr, "Pointer type kt=%d\n", ffecom_pointer_kind_);
   ffetype_set_kind (ffeinfo_type (FFEINFO_basictypeINTEGER,
@@ -12266,9 +12251,9 @@ ffecom_lookup_label (ffelab label)
                                                   1, 0));
          TREE_CONSTANT (glabel) = 1;
          TREE_STATIC (glabel) = 1;
-         DECL_CONTEXT (glabel) = 0;
+         DECL_CONTEXT (glabel) = current_function_decl;
          DECL_INITIAL (glabel) = NULL;
-         make_decl_rtl (glabel, NULL, 0);
+         make_decl_rtl (glabel, NULL);
          expand_decl (glabel);
 
          ffecom_save_tree_forever (glabel);
@@ -13570,7 +13555,7 @@ builtin_function (const char *name, tree type, int function_code,
   TREE_PUBLIC (decl) = 1;
   if (library_name)
     DECL_ASSEMBLER_NAME (decl) = get_identifier (library_name);
-  make_decl_rtl (decl, NULL_PTR, 1);
+  make_decl_rtl (decl, NULL_PTR);
   pushdecl (decl);
   DECL_BUILT_IN_CLASS (decl) = class;
   DECL_FUNCTION_CODE (decl) = function_code;
@@ -14428,7 +14413,7 @@ start_function (tree name, tree type, int nested, int public)
 
   if (TREE_CODE (current_function_decl) != ERROR_MARK)
     {
-      make_function_rtl (current_function_decl);
+      make_decl_rtl (current_function_decl, NULL);
 
       restype = TREE_TYPE (TREE_TYPE (current_function_decl));
       DECL_RESULT (current_function_decl)
@@ -14623,7 +14608,7 @@ init_parse (filename)
   else
     finput = fopen (filename, "r");
   if (finput == 0)
-    pfatal_with_name (filename);
+    fatal_io_error ("can't open %s", filename);
 
 #ifdef IO_BUFFER_SIZE
   setvbuf (finput, (char *) xmalloc (IO_BUFFER_SIZE), _IOFBF, IO_BUFFER_SIZE);
@@ -14678,13 +14663,16 @@ insert_block (block)
     = chainon (current_binding_level->blocks, block);
 }
 
-int
-lang_decode_option (argc, argv)
-     int argc;
-     char **argv;
-{
-  return ffe_decode_option (argc, argv);
-}
+/* Each front end provides its own.  */
+static void ffe_init PARAMS ((void));
+static void ffe_finish PARAMS ((void));
+static void ffe_init_options PARAMS ((void));
+
+struct lang_hooks lang_hooks = {ffe_init,
+                               ffe_finish,
+                               ffe_init_options,
+                               ffe_decode_option,
+                               NULL /* post_options */};
 
 /* used by print-tree.c */
 
@@ -14696,8 +14684,8 @@ lang_print_xnode (file, node, indent)
 {
 }
 
-void
-lang_finish ()
+static void
+ffe_finish ()
 {
   ffe_terminate_0 ();
 
@@ -14726,8 +14714,8 @@ lang_get_alias_set (t)
   return 0;
 }
 
-void
-lang_init_options ()
+static void
+ffe_init_options ()
 {
   /* Set default options for Fortran.  */
   flag_move_all_movables = 1;
@@ -14737,8 +14725,8 @@ lang_init_options ()
   flag_complex_divide_method = 1;
 }
 
-void
-lang_init ()
+static void
+ffe_init ()
 {
   /* If the file is output from cpp, it should contain a first line
      `# 1 "real-filename"', and the current design of gcc (toplev.c
@@ -15186,6 +15174,10 @@ set_block (block)
      register tree block;
 {
   current_binding_level->this_block = block;
+  current_binding_level->names = chainon (current_binding_level->names,
+                                         BLOCK_VARS (block));
+  current_binding_level->blocks = chainon (current_binding_level->blocks,
+                                          BLOCK_SUBBLOCKS (block));
 }
 
 /* ~~gcc/tree.h *should* declare this, because toplev.c references it.  */
@@ -16090,12 +16082,12 @@ ffecom_decode_include_option_ (char *spec)
       dirtmp = (struct file_name_list *)
        xmalloc (sizeof (struct file_name_list));
       dirtmp->next = 0;                /* New one goes on the end */
-      if (spec[0] != 0)
-       dirtmp->fname = spec;
-      else
-       fatal ("Directory name must immediately follow -I option with no intervening spaces, as in `-Idir', not `-I dir'");
+      dirtmp->fname = spec;
       dirtmp->got_name_map = 0;
-      append_include_chain (dirtmp, dirtmp);
+      if (spec[0] == 0)
+       error ("Directory name must immediately follow -I");
+      else
+       append_include_chain (dirtmp, dirtmp);
     }
   return 1;
 }