OSDN Git Service

* config/alpha/vms.h (INCLUDE_DEFAULTS): Add /gnu/lib/gcc-lib/include.
[pf3gnuchains/gcc-fork.git] / gcc / ch / tasking.c
index c0c1c9c..d1b7905 100644 (file)
@@ -1,5 +1,6 @@
 /* Implement tasking-related actions for CHILL.
-   Copyright (C) 1992, 93, 1994 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1993, 1994, 1998, 1999, 2000
+   Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -15,7 +16,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU CC; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
 
 #include "config.h"
 #include "system.h"
@@ -43,8 +45,19 @@ tree generic_signal_type_node;
 tree chill_taskingcode_type_node;
 
 /* forward declarations */
-void validate_process_parameters PROTO((tree));
-tree make_process_struct         PROTO((tree, tree));
+#if 0
+static void validate_process_parameters                PARAMS ((tree));
+static tree get_struct_variable_name           PARAMS ((tree));
+static tree decl_tasking_code_variable         PARAMS ((tree, tree *, int));
+#endif
+static tree get_struct_debug_type_name         PARAMS ((tree));
+static tree get_process_wrapper_name           PARAMS ((tree));
+static tree build_tasking_enum                 PARAMS ((void));
+static void build_tasking_message_type         PARAMS ((void));
+static tree build_receive_signal_case_label    PARAMS ((tree, tree));
+static tree build_receive_buffer_case_label    PARAMS ((tree, tree));
+static void build_receive_buffer_case_end      PARAMS ((tree, tree));
+static void build_receive_signal_case_end      PARAMS ((tree, tree));
 
 /* list of this module's process, buffer, etc. decls.
  This is a list of TREE_VECs, chain by their TREE_CHAINs. */
@@ -57,18 +70,19 @@ tree tasking_list = NULL_TREE;
 #define TASK_INFO_STUFF_TYPE(NODE) TREE_VEC_ELT(NODE,4)
 
 /* name template for process argument type */
-static char * struct_name = "__tmp_%s_arg_type";
+#define STRUCT_NAME "__tmp_%s_arg_type"
 
 /* name template for process arguments for debugging type */
-static char * struct_debug_name = "__tmp_%s_debug_type";
+#define STRUCT_DEBUG_NAME "__tmp_%s_debug_type"
 
-#if 0
 /* name template for process argument variable */
-static char * data_name = "__tmp_%s_arg_variable";
-#endif
+#define DATA_NAME  "__tmp_%s_arg_variable"
 
 /* name template for process wrapper */
-static char * wrapper_name = "__tmp_%s_wrapper";
+#define WRAPPER_NAME "__tmp_%s_wrapper"
+
+/* name template for process code */
+#define SKELNAME "__tmp_%s_code"
 
 extern int ignoring;
 static tree void_ftype_void;
@@ -79,21 +93,21 @@ tree
 get_struct_type_name (name)
      tree name;
 {
-  char *idp = IDENTIFIER_POINTER (name);        /* process name */
-  char *tmpname = xmalloc (strlen (idp) + strlen (struct_name) + 1);
+  const char *idp = IDENTIFIER_POINTER (name);        /* process name */
+  char *tmpname = xmalloc (strlen (idp) + sizeof (STRUCT_NAME));
 
-  sprintf (tmpname, struct_name, idp);
+  sprintf (tmpname, STRUCT_NAME, idp);
   return get_identifier (tmpname);
 }
 
-tree
+static tree
 get_struct_debug_type_name (name)
      tree name;
 {
-  char *idp = IDENTIFIER_POINTER (name);        /* process name */
-  char *tmpname = xmalloc (strlen (idp) + strlen (struct_debug_name) + 1);
+  const char *idp = IDENTIFIER_POINTER (name);        /* process name */
+  char *tmpname = xmalloc (strlen (idp) + sizeof (STRUCT_DEBUG_NAME));
 
-  sprintf (tmpname, struct_debug_name, idp);
+  sprintf (tmpname, STRUCT_DEBUG_NAME, idp);
   return get_identifier (tmpname);
 }
 
@@ -102,12 +116,11 @@ tree
 get_tasking_code_name (name)
      tree name;
 {
-  char *skelname = "__tmp_%s_code";
-  char *name_str = IDENTIFIER_POINTER (name);
-  char *tmpname  = (char *)alloca (IDENTIFIER_LENGTH (name) +
-                                  strlen (skelname) + 1);
-
-  sprintf (tmpname, skelname, name_str);
+  const char *name_str = IDENTIFIER_POINTER (name);
+  char *tmpname  = (char *) alloca (IDENTIFIER_LENGTH (name) +
+                                   sizeof (SKELNAME));
+  
+  sprintf (tmpname, SKELNAME, name_str);
   return get_identifier (tmpname);
 }
 
@@ -116,10 +129,10 @@ static tree
 get_struct_variable_name (name)
      tree name;
 {
-  char *idp = IDENTIFIER_POINTER (name);        /* process name */
-  char *tmpname = xmalloc (strlen (idp) + strlen (data_name) + 1);
+  const char *idp = IDENTIFIER_POINTER (name);        /* process name */
+  char *tmpname = xmalloc (strlen (idp) + sizeof (DATA_NAME));
 
-  sprintf (tmpname, data_name, idp);
+  sprintf (tmpname, DATA_NAME, idp);
   return get_identifier (tmpname);
 }
 #endif
@@ -128,10 +141,10 @@ static tree
 get_process_wrapper_name (name)
     tree name;
 {
-  char *idp = IDENTIFIER_POINTER (name);
-  char *tmpname = xmalloc (strlen (idp) + strlen (wrapper_name) + 1);
+  const char *idp = IDENTIFIER_POINTER (name);
+  char *tmpname = xmalloc (strlen (idp) + sizeof (WRAPPER_NAME));
     
-  sprintf (tmpname, wrapper_name, idp);
+  sprintf (tmpname, WRAPPER_NAME, idp);
   return get_identifier (tmpname);
 }
 \f
@@ -154,7 +167,7 @@ generate_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
       /* check for value should be assigned is out of range */
       if (TREE_INT_CST_LOW (*tasking_code_ptr) >
          TREE_INT_CST_LOW (TYPE_MAX_VALUE (chill_taskingcode_type_node)))
-         error ("Tasking code %ld out of range for `%s'.",
+         error ("tasking code %ld out of range for `%s'",
                 (long) TREE_INT_CST_LOW (*tasking_code_ptr),
                 IDENTIFIER_POINTER (name));
     }
@@ -181,7 +194,8 @@ generate_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
  * be initialized.  The other module will do that.  This is just 
  * for BUFFERs and EVENTs.
  */
-tree
+#if 0
+static tree
 decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
      tree name, *tasking_code_ptr;
      int  quasi_flag;
@@ -201,7 +215,7 @@ decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
       /* check for value should be assigned is out of range */
       if (TREE_INT_CST_LOW (*tasking_code_ptr) >
          TREE_INT_CST_LOW (TYPE_MAX_VALUE (chill_taskingcode_type_node)))
-         error ("Tasking code %ld out of range for `%s'.",
+         error ("tasking code %ld out of range for `%s'",
                 (long) TREE_INT_CST_LOW (*tasking_code_ptr),
                 IDENTIFIER_POINTER (name));
     }
@@ -222,6 +236,7 @@ decl_tasking_code_variable (name, tasking_code_ptr, quasi_flag)
                                     *tasking_code_ptr));
   return decl;
 }
+#endif
 \f
 /*
  * Transmute a process parameter list into an argument structure 
@@ -266,7 +281,7 @@ make_process_struct (name, processparlist)
            {
              for (field = parnamelist; field != NULL_TREE;
                   field = TREE_CHAIN (field))
-               error ("invalid attribute for argument `%s' (only IN or LOC allowed).",
+               error ("invalid attribute for argument `%s' (only IN or LOC allowed)",
                       IDENTIFIER_POINTER (TREE_VALUE (field)));
            }
        }
@@ -491,11 +506,13 @@ build_process_wrapper (plabel, processdata)
     property"
  */
 
-void
+#if 0
+static void
 validate_process_parameters (parms)
      tree parms ATTRIBUTE_UNUSED;
 {
 }
+#endif
 \f
 /*
  * build the tree for a start process action.  Loop through the
@@ -514,7 +531,7 @@ build_start_process (process_name, copynum,
                     exprlist, optset)
      tree process_name, copynum, exprlist, optset;
 {
-  tree process_decl, struct_type_node;
+  tree process_decl = NULL_TREE, struct_type_node = NULL_TREE;
   tree result;
   tree valtail, typetail;
   tree tuple = NULL_TREE, actuallist = NULL_TREE;
@@ -534,7 +551,7 @@ build_start_process (process_name, copynum,
       else if (TREE_CODE (process_decl) != FUNCTION_DECL
          || ! CH_DECL_PROCESS (process_decl))
        {
-         error ("You may only START a process, not a proc");
+         error ("you may only START a process, not a proc");
          process_decl = NULL_TREE;
        }
       else if (DECL_EXTERNAL (process_decl))
@@ -570,7 +587,7 @@ build_start_process (process_name, copynum,
       if (optset == NULL_TREE) ;
       else if (!CH_REFERABLE (optset))
        {
-         error ("SET expression not a location.");
+         error ("SET expression not a location");
          optset = NULL_TREE;
        }
       else if (!CH_IS_INSTANCE_MODE (TREE_TYPE (optset)))
@@ -611,19 +628,19 @@ build_start_process (process_name, copynum,
   
       if (valtail != 0 && TREE_VALUE (valtail) != void_type_node)
        {
-         char *errstr = "too many arguments to process";
          if (process_name)
-           error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name));
+           error ("too many arguments to process `%s'",
+                  IDENTIFIER_POINTER (process_name));
          else
-           error (errstr);
+           error ("too many arguments to process");
        }
       else if (typetail != 0 && TREE_VALUE (typetail) != void_type_node)
        {
-         char *errstr = "too few arguments to process";
          if (process_name)
-           error ("%s `%s'", errstr, IDENTIFIER_POINTER (process_name));
+           error ("too few arguments to process `%s'",
+                  IDENTIFIER_POINTER (process_name));
          else
-           error (errstr);
+           error ("too few arguments to process");
        }
       else
       {
@@ -747,8 +764,7 @@ build_tasking_struct ()
   /* We temporarily reset the maximum_field_alignment to zero so the
      compiler's init data structures can be compatible with the
      run-time system, even when we're compiling with -fpack. */
-  extern int maximum_field_alignment;
-  int save_maximum_field_alignment = maximum_field_alignment;
+  unsigned int save_maximum_field_alignment = maximum_field_alignment;
   maximum_field_alignment = 0;
 
   decl1 = build_decl (FIELD_DECL, get_identifier ("TaskName"),
@@ -925,7 +941,7 @@ void
 add_taskstuff_to_list (code_decl, stufftype, stuffnumber,
                       proc_decl, entry)
      tree code_decl;
-     char *stufftype;
+     const char *stufftype;
      tree stuffnumber, proc_decl, entry;
 {
   if (pass == 1)
@@ -988,7 +1004,7 @@ build_gen_code (decl)
     result = (tree)(DECL_TASKING_CODE_DECL (decl));
   else
     {
-      error ("GEN_CODE argument must be a process or signal name.");
+      error ("GEN_CODE argument must be a process or signal name");
       return error_mark_node;
     }
   CH_DERIVED_FLAG (result) = 1;
@@ -1100,7 +1116,7 @@ build_queue_length (buf_ev)
   if (CH_IS_BUFFER_MODE (TREE_TYPE (buf_ev)) ||
       CH_IS_EVENT_MODE (TREE_TYPE (buf_ev)))
     {
-      char *field_name;
+      const char *field_name;
       tree  arg1, arg2;
 
       if (CH_IS_EVENT_MODE (TREE_TYPE (buf_ev)))
@@ -1120,7 +1136,7 @@ build_queue_length (buf_ev)
                       tree_cons (NULL_TREE, arg2, NULL_TREE)));
     }
 
-  error ("QUEUE_LENGTH argument must be a BUFFER/EVENT location.");
+  error ("QUEUE_LENGTH argument must be a BUFFER/EVENT location");
   return error_mark_node;
 }
 \f
@@ -1202,29 +1218,28 @@ build_instance_type ()
   pointer_to_instance = build_chill_pointer_type (instance_type_node);
 }
 \f
-#if 0
+/*
  *
  * The tasking message descriptor looks like this C structure:
  *
  * typedef struct
  *   {
- *     short *sc;                 /* ptr to code integer */
- *     int    data_len;           /* length of signal/buffer data msg */
- *     void  *data;               /* ptr to signal/buffer data */
+ *     short *sc;                 // ptr to code integer
+ *     int    data_len;           // length of signal/buffer data msg
+ *     void  *data;               // ptr to signal/buffer data
  *   } SignalDescr;
  *
  *
-#endif
+ */
 
-void
+static void
 build_tasking_message_type ()
 {
   tree type_name;
   tree temp;
   /* We temporarily reset maximum_field_alignment to deal with
      the runtime system. */
-  extern int maximum_field_alignment;
-  int save_maximum_field_alignment = maximum_field_alignment;
+  unsigned int save_maximum_field_alignment = maximum_field_alignment;
   tree field1, field2, field3;
 
   maximum_field_alignment = 0;
@@ -1272,7 +1287,7 @@ build_signal_descriptor (sigdef, exprlist)
       || ! CH_DECL_SIGNAL (sigdef))
     {
       error ("SEND requires a SIGNAL; %s is not a SIGNAL name", 
-            signame);
+            IDENTIFIER_POINTER (signame));
       return error_mark_node;
     }
   if (CH_TYPE_NONVALUE_P (TREE_TYPE (sigdef)))
@@ -1380,7 +1395,7 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
          /* issue a warning in case of -Wall */
          if (extra_warnings)
            {
-             warning ("Signal sent without priority");
+             warning ("signal sent without priority");
              warning (" and no default priority was set.");
              warning (" PRIORITY defaulted to 0");
            }
@@ -1418,7 +1433,7 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
                           tree_cons (NULL_TREE, copy_number, NULL_TREE)));
          /* as our system doesn't allow that and Z.200 specifies it,
             we issue a warning */
-         warning ("SEND to ANY copy of process `%s'.", IDENTIFIER_POINTER (process_name));
+         warning ("SEND to ANY copy of process `%s'", IDENTIFIER_POINTER (process_name));
         }
     }
   else if (! CH_IS_INSTANCE_MODE (TREE_TYPE (optsendto)))
@@ -1471,7 +1486,7 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
                  tree_cons (NULL_TREE, linenumber, NULL_TREE)))))))));
 }
 \f
-#if 0
+/*
  * The following code builds a RECEIVE CASE action, which actually
  * has 2 different functionalities:
  *
@@ -1497,16 +1512,16 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
  *        STOP;
  *      ESAC;
  *
- * Because we don''t know until we get to the ESAC how
+ * Because we don't know until we get to the ESAC how
  * many signals need processing, we generate the following
  * C-equivalent code:
  *
- * /* define the codes for the signals */
+ * // define the codes for the signals
  * static short __tmp_advance_code;
  * static short __tmp_terminate_code;
  * static short __tmp_sig1_code;
  *
- * /* define the types of the signals */
+ * // define the types of the signals
  * typedef struct
  *  {
  *     char fld0;
@@ -1521,7 +1536,7 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
  * static short count;
  * static char char_code;
  *
- * {               /* start a new symbol context */
+ * {               // start a new symbol context
  *   int    number_of_sigs;
  *   short *sig_code [];
  *   void  *sigdatabuf;
@@ -1539,22 +1554,22 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
  *                                 &instance_loc);
  *   if (sigcode == __tmp_advance_code)
  *     {
- *       /* code for advance alternative's action_statement_list */
+ *       // code for advance alternative's action_statement_list
  *       count++;
  *     }
  *   else if (sigcode == __tmp_terminate_code)
  *     {
- *        /* copy signal's data to where they belong,
- *           with range-check, if enabled */
+ *        // copy signal's data to where they belong,
+ *           with range-check, if enabled
  *        char_code = ((__tmp_terminate_struct *)sigdatabuf)->fld0;
  *
- *       /* code for terminate alternative's action_statement_list */
+ *       // code for terminate alternative's action_statement_list
  *        __send_signal (sig1 ..... );
  *        goto __workloop_end;
  *     }
  *   else
  *     {
- *        /* code here for the ELSE action_statement_list */
+ *        // code here for the ELSE action_statement_list
  *        __stop_process ();
  *     }
  *   goto __rc_done;
@@ -1571,7 +1586,7 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
  *   goto __rcdoit;
  *
  * __rc_done: ;
- * }               /* end the new symbol context */
+ * }               // end the new symbol context
  * __workloop_end: ;
  *
  *
@@ -1597,7 +1612,7 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
  *          STOP;
  *      ESAC;
  *
- * Because we don''t know until we get to the ESAC how
+ * Because we don't know until we get to the ESAC how
  * many buffers need processing, we generate the following
  * C-equivalent code:
  *
@@ -1615,7 +1630,7 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
  * static short count;
  *
  * workloop:
- * {                     /* start a new symbol context */
+ * {                     // start a new symbol context
  *   int     number_of_sigs;
  *   void   *sig_code [];
  *   void   *sigdatabuf;
@@ -1669,10 +1684,10 @@ expand_send_signal (sigmsgbuffer, optroutinginfo, optsendto,
  *   goto __rcdoit;
  *
  *  __rc_done;
- * }          /* end of symbol context */
+ * }          // end of symbol context
  * __workloop_end:
  *
-#endif
+ */
 \f
 struct rc_state_type
 {
@@ -1706,7 +1721,7 @@ build_receive_case_if_generated()
 {
   if (!current_rc_state)
     {
-      error ("internal error: RECEIVE CASE stack invalid.");
+      error ("internal error: RECEIVE CASE stack invalid");
       abort ();
     }
   return current_rc_state->if_generated;
@@ -1938,13 +1953,13 @@ build_receive_buffer_case_label (buffer, loclist)
 
   if (! CH_REFERABLE (buffer))
     {
-      error ("BUFFER in RECEIVE CASE alternative must be a location.");
+      error ("BUFFER in RECEIVE CASE alternative must be a location");
       return error_mark_node;
     }
 
   if (TREE_CHAIN (loclist) != NULL_TREE)
     {
-      error ("buffer receive alternative requires only 1 defining occurence.");
+      error ("buffer receive alternative requires only 1 defining occurrence");
       return error_mark_node;
     }
 
@@ -1954,7 +1969,7 @@ build_receive_buffer_case_label (buffer, loclist)
 
       /* here we change the mode of rc_state->sig_code to
         REF ARRAY (0:65535) REF __tmp_DESCR_type.
-        This is neccesary, cause we cannot evaluate the buffer twice
+        This is necessary, cause we cannot evaluate the buffer twice
         (once here where we compare against the address of the buffer
         and second in build_receive_buffer_case_end, where we use the
         address build the descriptor, which gets passed to __wait_buffer).
@@ -2025,13 +2040,13 @@ build_receive_buffer_case_label (buffer, loclist)
     had_errors = 1;
   else if (! CH_COMPATIBLE (var, buftype))
     {
-      error ("incompatible modes in receive buffer alternative.");
+      error ("incompatible modes in receive buffer alternative");
       had_errors = 1;
     }
 
   if (! CH_LOCATION_P (var))
     {
-      error ("defining occurence in receive buffer alternative must be a location.");
+      error ("defining occurrence in receive buffer alternative must be a location");
       had_errors = 1;
     }
 
@@ -2068,13 +2083,13 @@ build_receive_case_label (signame, loclist)
     {
       if (loclist == NULL_TREE)
        {
-         error ("buffer receive alternative without `IN location'.");
+         error ("buffer receive alternative without `IN location'");
          return error_mark_node;
        }
       return build_receive_buffer_case_label (signame, loclist);
     }
 
-  error ("RECEIVE CASE alternative must specify a SIGNAL name or BUFFER location.");
+  error ("RECEIVE CASE alternative must specify a SIGNAL name or BUFFER location");
   return error_mark_node;
 }
 \f
@@ -2082,11 +2097,11 @@ build_receive_case_label (signame, loclist)
  * LABEL_CNT is the case-label counter passed from build_receive_case_start.
  * ELSE_CLAUSE defines if the RECEIVE CASE action had an ELSE(1) or not(0).
  * BUF_LIST is a tree-list of tree-lists, where TREE_VALUE defines the 
- * BUFFER location and TREE_PURPOSE defines the defining occurence.
+ * BUFFER location and TREE_PURPOSE defines the defining occurrence.
  */
 static void
-build_receive_buffer_case_end (label_cnt, buf_list, else_clause)
-     tree label_cnt, buf_list, else_clause;
+build_receive_buffer_case_end (buf_list, else_clause)
+     tree buf_list, else_clause;
 {
   struct rc_state_type *rc_state = current_rc_state;
   tree alist;
@@ -2185,8 +2200,8 @@ build_receive_buffer_case_end (label_cnt, buf_list, else_clause)
  * case-label counter passed from build_receive_case_start.
  */
 static void
-build_receive_signal_case_end (label_cnt, sig_list, else_clause)
-     tree label_cnt, sig_list, else_clause;
+build_receive_signal_case_end (sig_list, else_clause)
+     tree sig_list, else_clause;
 {
   struct rc_state_type *rc_state = current_rc_state;
   tree alist, temp1;
@@ -2285,8 +2300,8 @@ build_receive_signal_case_end (label_cnt, sig_list, else_clause)
 /* General function for the end of a RECEIVE CASE action */
 
 void
-build_receive_case_end (label_cnt, alist, else_clause)
-     tree label_cnt, alist, else_clause;
+build_receive_case_end (alist, else_clause)
+     tree alist, else_clause;
 {
   rtx rcdone = gen_label_rtx ();
   struct rc_state_type *rc_state = current_rc_state;
@@ -2322,9 +2337,9 @@ build_receive_case_end (label_cnt, alist, else_clause)
 
   /* now call the actual end function */
   if (rc_state->bufseen)
-    build_receive_buffer_case_end (label_cnt, alist, else_clause);
+    build_receive_buffer_case_end (alist, else_clause);
   else
-    build_receive_signal_case_end (label_cnt, alist, else_clause);
+    build_receive_signal_case_end (alist, else_clause);
 
   /* now jump to the beginning of RECEIVE CASE processing */
 gen_rcdoit: ;
@@ -2351,7 +2366,7 @@ void expand_continue_event (evloc)
 
   if (! CH_REFERABLE (evloc) || ! CH_IS_EVENT_MODE (TREE_TYPE (evloc)))
     {
-      error ("CONTINUE requires an event location.");
+      error ("CONTINUE requires an event location");
       return;
     }
 
@@ -2366,7 +2381,7 @@ void expand_continue_event (evloc)
           tree_cons (NULL_TREE, linenumber, NULL_TREE)))));
 }
 \f
-#if 0
+/*
  * The following code builds a DELAY CASE statement,
  * which looks like this in CHILL:
  *
@@ -2379,12 +2394,12 @@ void expand_continue_event (evloc)
  *      (ev2, ev3): count2 +:= 1;
  *    ESAC; 
  *
- * Because we don''t know until we get to the ESAC how
+ * Because we don't know until we get to the ESAC how
  * many events need processing, we generate the following
  * C-equivalent code:
  *
  *
- * {               /* start a new symbol context */
+ * {               // start a new symbol context
  *   typedef struct
  *   {
  *      void           *p;
@@ -2404,12 +2419,12 @@ void expand_continue_event (evloc)
  *                                    linenumber);
  *   if (whatevent == &ev1)
  *     {
- *       /* code for ev1 alternative's action_statement_list */
+ *       // code for ev1 alternative's action_statement_list
  *       count1 += 1;
  *     }
  *   else if (whatevent == &ev2 || whatevent == &ev3)
  *     {
- *       /* code for ev2 and ev3 alternative's action_statement_list */
+ *       // code for ev2 and ev3 alternative's action_statement_list
  *       count2 += 1;
  *     }
  *   goto __dl_done;
@@ -2425,9 +2440,9 @@ void expand_continue_event (evloc)
  *
  * __dl_done: 
  *   ;
- * }               /* end the new symbol context */
+ * }               // end the new symbol context
  *
-#endif
+ */
 \f
 struct dl_state_type
 {
@@ -2485,7 +2500,7 @@ build_delay_case_start (optset, optpriority)
     optpriority = integer_zero_node;
   else if (TREE_CODE (TREE_TYPE (optpriority)) != INTEGER_TYPE)
     {
-      error ("PRIORITY must be of integer type.");
+      error ("PRIORITY must be of integer type");
       optpriority = integer_zero_node;
     }
 
@@ -2563,7 +2578,7 @@ build_delay_case_label (eventlist, if_or_elseif)
        temp1 = null_pointer_node;
       else if (! CH_IS_EVENT_MODE (TREE_TYPE (event)) || ! CH_REFERABLE (event))
        {
-         error ("delay alternative must be an EVENT location.");
+         error ("delay alternative must be an EVENT location");
          temp1 = null_pointer_node;
        }
       else
@@ -2594,8 +2609,8 @@ build_delay_case_label (eventlist, if_or_elseif)
  * passed from build_delay_case_start.
  */
 void
-build_delay_case_end (label_cnt, event_list)
-     tree label_cnt, event_list;
+build_delay_case_end (event_list)
+     tree event_list;
 {
   struct dl_state_type *dl_state = current_dl_state;
   rtx    dldone          = gen_label_rtx ();
@@ -2693,7 +2708,7 @@ gen_dldoit:
   free(dl_state);
 }
 \f
-#if 0
+/*
  * The following code builds a simple delay statement,
  * which looks like this in CHILL:
  *
@@ -2714,16 +2729,15 @@ gen_dldoit:
  *
  * static short __tmp_ev1_code;
  * 
- * {  /* start a new symbol context */
+ * {  // start a new symbol context
  *
  *   Descr __delay_array[1] = { { ev1, 5 } };
  *
  *   __delay_event (1, &__delay_array, 7, NULL,
  *                 filename, linenumber);
  *
- * } /* end of symbol scope */
+ * } // end of symbol scope
  */
-#endif
 void
 build_delay_action (event, optpriority)
        tree event, optpriority;
@@ -2739,7 +2753,7 @@ build_delay_action (event, optpriority)
     had_errors = 1;
   else if (! CH_IS_EVENT_MODE (TREE_TYPE (event)) || ! CH_REFERABLE (event))
     {
-      error ("DELAY action requires an event location.");
+      error ("DELAY action requires an event location");
       had_errors = 1;
     }
 
@@ -2750,7 +2764,7 @@ build_delay_action (event, optpriority)
        return;
       if (TREE_CODE (TREE_TYPE (optpriority)) != INTEGER_TYPE)
        {
-         error ("PRIORITY in DELAY action must be of integer type.");
+         error ("PRIORITY in DELAY action must be of integer type");
          return;
        }
     }
@@ -2760,7 +2774,7 @@ build_delay_action (event, optpriority)
       if (extra_warnings)
        {
          warning ("DELAY action without priority.");
-         warning (" PRIORITY defaulted to 0.");
+         warning (" PRIORITY defaulted to 0");
        }
       optpriority = integer_zero_node;
     }
@@ -2850,7 +2864,7 @@ expand_send_buffer (buffer, value, optpriority, optwith, optto)
     {
       if (! CH_IS_BUFFER_MODE (TREE_TYPE (buffer)) || ! CH_REFERABLE (buffer))
        {
-         error ("send buffer action requires a BUFFER location.");
+         error ("send buffer action requires a BUFFER location");
          had_errors = 1;
        }
       else
@@ -2867,7 +2881,7 @@ expand_send_buffer (buffer, value, optpriority, optwith, optto)
     {
       if (TREE_CHAIN (value) != NULL_TREE)
        {
-         error ("there must be only 1 value for send buffer action.");
+         error ("there must be only 1 value for send buffer action");
          had_errors = 1;
        }
       else
@@ -2888,13 +2902,13 @@ expand_send_buffer (buffer, value, optpriority, optwith, optto)
                  value = convert (TREE_TYPE (buffer_mode_decl), value);
                  if (value == NULL_TREE || TREE_CODE (value) == ERROR_MARK)
                    {
-                     error ("convert failed for send buffer action.");
+                     error ("convert failed for send buffer action");
                      had_errors = 1;
                    }
                }
              else
                {
-                 error ("incompatible modes in send buffer action.");
+                 error ("incompatible modes in send buffer action");
                  had_errors = 1;
                }
            }
@@ -2909,9 +2923,9 @@ expand_send_buffer (buffer, value, optpriority, optwith, optto)
          /* issue a warning in case of -Wall */
          if (extra_warnings)
            {
-             warning ("Buffer sent without priority");
+             warning ("buffer sent without priority");
              warning (" and no default priority was set.");
-             warning (" PRIORITY defaulted to 0.");
+             warning (" PRIORITY defaulted to 0");
            }
          optpriority = integer_zero_node;
        }
@@ -2922,18 +2936,18 @@ expand_send_buffer (buffer, value, optpriority, optwith, optto)
     had_errors = 1;
   else if (TREE_CODE (TREE_TYPE (optpriority)) != INTEGER_TYPE)
     {
-      error ("PRIORITY must be of integer type.");
+      error ("PRIORITY must be of integer type");
       had_errors = 1;
     }
 
   if (optwith != NULL_TREE)
     {
-      error ("WITH not allowed for send buffer action.");
+      error ("WITH not allowed for send buffer action");
       had_errors = 1;
     }
   if (optto != NULL_TREE)
     {
-      error ("TO not allowed for send buffer action.");
+      error ("TO not allowed for send buffer action");
       had_errors = 1;
     }
   if (had_errors)
@@ -3209,8 +3223,8 @@ invalidate_buffer_element_mode (bufmode)
    perform various error checks.  Return a new queue size. */
 
 tree
-check_queue_size (type, qsize)
-     tree type, qsize;
+check_queue_size (qsize)
+     tree qsize;
 {
   if (qsize == NULL_TREE || TREE_CODE (qsize) == ERROR_MARK)
     return qsize;
@@ -3294,7 +3308,7 @@ tasking_init ()
          build_tree_list (NULL_TREE, void_type_node)));
 
   builtin_function ("__whoami", ins_ftype_void,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
 
   build_tasking_message_type ();
    
@@ -3309,22 +3323,22 @@ tasking_init ()
 
   builtin_function ((ignore_case || ! special_UC) ? "copy_number" : "COPY_NUMBER",
                    chill_predefined_function_type,
-                   BUILT_IN_COPY_NUMBER, NULL_PTR);
+                   BUILT_IN_COPY_NUMBER, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "gen_code" : "GEN_CODE",
                    chill_predefined_function_type,
-                   BUILT_IN_GEN_CODE, NULL_PTR);
+                   BUILT_IN_GEN_CODE, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "gen_inst" : "GEN_INST",
                    chill_predefined_function_type,
-                   BUILT_IN_GEN_INST, NULL_PTR);
+                   BUILT_IN_GEN_INST, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "gen_ptype" : "GEN_PTYPE",
                    chill_predefined_function_type,
-                   BUILT_IN_GEN_PTYPE, NULL_PTR);
+                   BUILT_IN_GEN_PTYPE, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "proc_type" : "PROC_TYPE",
                    chill_predefined_function_type,
-                   BUILT_IN_PROC_TYPE, NULL_PTR);
+                   BUILT_IN_PROC_TYPE, BUILT_IN_NORMAL, NULL_PTR);
   builtin_function ((ignore_case || ! special_UC) ? "queue_length" : "QUEUE_LENGTH",
                    chill_predefined_function_type,
-                   BUILT_IN_QUEUE_LENGTH, NULL_PTR);
+                   BUILT_IN_QUEUE_LENGTH, BUILT_IN_NORMAL, NULL_PTR);
 
   int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int
      = build_function_type (integer_type_node,
@@ -3393,23 +3407,23 @@ tasking_init ()
                    endlink)));
 
   builtin_function ("__delay_event", int_ftype_ptr_int_ptr_int_ptr_ptr_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__queue_length", int_ftype_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__register_tasking", void_ftype_ptr,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__send_signal", void_ftype_ptr_ins_int_int_ptr_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__send_buffer", int_ftype_ptr_ptr_int_ptr_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__start_process", void_ftype_int_int_int_ptr_ptr_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
-  builtin_function ("__stop_process", void_ftype_void, NOT_BUILT_IN,
+                   0, NOT_BUILT_IN, NULL_PTR);
+  builtin_function ("__stop_process", void_ftype_void, 0, NOT_BUILT_IN,
                    NULL_PTR);
   builtin_function ("__wait_buffer", int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
   builtin_function ("__wait_signal_timed", int_ftype_ptr_int_ptr_ptr_int_ptr_int_ptr_ptr_int,
-                   NOT_BUILT_IN, NULL_PTR);
+                   0, NOT_BUILT_IN, NULL_PTR);
 
   infinite_buffer_event_length_node = build_int_2 (-1, 0);
   TREE_TYPE (infinite_buffer_event_length_node) = long_integer_type_node;