home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / GnuSource / cc-61.0.1 / cc / event-diffs < prev    next >
Text File  |  1991-07-19  |  9KB  |  338 lines

  1. *** ../../fsf2/toplev.c    Thu May 23 13:29:19 1991
  2. --- ./toplev.c    Thu Jul 18 16:05:35 1991
  3. ***************
  4. *** 600,605 ****
  5. --- 600,636 ----
  6.     return 1;
  7.   }
  8.   
  9. + #ifdef REPORT_EVENT
  10. + static void
  11. + report_event (type, decl, file, line, msg, arg1, arg2, arg3)
  12. +       int type;
  13. +       tree decl;
  14. +       char *file;
  15. +       char *line;
  16. +       char *msg;
  17. +       int arg1;
  18. +       int arg2;
  19. +       int arg3;
  20. + {
  21. +   char *name, *kind;
  22. + #ifdef NeXT
  23. +   extern tree maybe_objc_method_name ();
  24. +   tree method_name = maybe_objc_method_name ();
  25. + #endif /* NeXT */
  26. +   if (decl == NULL)
  27. +     name = "top level";
  28. + #ifdef NeXT
  29. +   else if (method_name)
  30. +     name = IDENTIFIER_POINTER (method_name);
  31. + #endif /* NeXT */
  32. +   else
  33. +     name = (*decl_printable_name) (decl, &kind);
  34. +   REPORT_EVENT (type, name, file, line, msg, arg1, arg2, arg3);
  35. + }
  36. + #endif
  37.   /* Print a fatal error message.  NAME is the text.
  38.      Also include a system error message based on `errno'.  */
  39.   
  40. ***************
  41. *** 607,612 ****
  42. --- 638,647 ----
  43.   pfatal_with_name (name)
  44.        char *name;
  45.   {
  46. + #ifdef REPORT_EVENT
  47. +   report_event (0, current_function_decl, input_filename, lineno,
  48. +          "%s: ", name, strerror (errno), 0);
  49. + #endif
  50.     fprintf (stderr, "%s: ", progname);
  51.     perror (name);
  52.     exit (35);
  53. ***************
  54. *** 616,621 ****
  55. --- 651,660 ----
  56.   fatal_io_error (name)
  57.        char *name;
  58.   {
  59. + #ifdef REPORT_EVENT
  60. +   report_event (0, current_function_decl, input_filename, lineno,
  61. +          "%s: I/O error\n", name, 0, 0);
  62. + #endif
  63.     fprintf (stderr, "%s: %s: I/O error\n", progname, name);
  64.     exit (35);
  65.   }
  66. ***************
  67. *** 700,705 ****
  68. --- 739,749 ----
  69.     if (last_error_function != current_function_decl)
  70.       {
  71.         char *kind = "function";
  72. + #ifdef NeXT
  73. +       extern tree maybe_objc_method_name ();
  74. +       tree method_name = maybe_objc_method_name ();
  75. + #endif /* NeXT */
  76.         if (current_function_decl != 0
  77.         && TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
  78.       kind = "method";
  79. ***************
  80. *** 709,714 ****
  81. --- 753,763 ----
  82.   
  83.         if (current_function_decl == NULL)
  84.       fprintf (stderr, "At top level:\n");
  85. + #ifdef NeXT
  86. +       else if (method_name)
  87. +     fprintf (stderr, "In method `%s'\n",
  88. +          IDENTIFIER_POINTER (method_name));
  89. + #endif /* NeXT */
  90.         else
  91.       {
  92.         char *name = (*decl_printable_name) (current_function_decl, &kind);
  93. ***************
  94. *** 759,764 ****
  95. --- 808,816 ----
  96.   
  97.     report_error_function (file);
  98.   
  99. + #ifdef REPORT_EVENT
  100. +   report_event (0, current_function_decl, file, line, s, v, v2, 0);
  101. + #endif
  102.     if (file)
  103.       fprintf (stderr, "%s:%d: ", file, line);
  104.     else
  105. ***************
  106. *** 781,786 ****
  107. --- 833,848 ----
  108.   
  109.     report_error_function (DECL_SOURCE_FILE (decl));
  110.   
  111. + #ifdef REPORT_EVENT
  112. +   if (DECL_NAME (decl))
  113. +     report_event (0, current_function_decl,
  114. +            DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
  115. +             s, (*decl_printable_name) (decl, &junk), v, 0);
  116. +   else
  117. +     report_event (0, current_function_decl,
  118. +            DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
  119. +             s, "((anonymous))", v, 0);
  120. + #endif
  121.     fprintf (stderr, "%s:%d: ",
  122.          DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
  123.   
  124. ***************
  125. *** 843,848 ****
  126. --- 905,913 ----
  127.   
  128.     report_error_function (file);
  129.   
  130. + #ifdef REPORT_EVENT
  131. +   report_event (1, current_function_decl, file, line, s, v, v2, v3);
  132. + #endif
  133.     if (file)
  134.       fprintf (stderr, "%s:%d: ", file, line);
  135.     else
  136. ***************
  137. *** 883,888 ****
  138. --- 948,963 ----
  139.   
  140.     report_error_function (DECL_SOURCE_FILE (decl));
  141.   
  142. + #ifdef REPORT_EVENT
  143. +   if (DECL_NAME (decl))
  144. +     report_event (1, current_function_decl,
  145. +            DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
  146. +             s, (*decl_printable_name) (decl, &junk), v, 0);
  147. +   else
  148. +     report_event (1, current_function_decl,
  149. +            DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl),
  150. +             s, "((anonymous))", v, 0);
  151. + #endif
  152.     fprintf (stderr, "%s:%d: ",
  153.          DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
  154.   
  155. ***************
  156. *** 944,949 ****
  157. --- 1019,1028 ----
  158.        int v, v2;
  159.   {
  160.     sorrycount++;
  161. + #ifdef REPORT_EVENT
  162. +   report_event (0, current_function_decl, input_filename, lineno,
  163. +          s, v, v2, 0);
  164. + #endif
  165.     if (input_filename)
  166.       fprintf (stderr, "%s:%d: ", input_filename, lineno);
  167.     else
  168. ***************
  169. *** 962,967 ****
  170. --- 1041,1050 ----
  171.        char *s;
  172.        int v, v2;
  173.   {
  174. + #ifdef REPORT_EVENT
  175. +   report_event (0, current_function_decl, input_filename, lineno,
  176. +          s, v, v2, 0);
  177. + #endif
  178.     if (input_filename)
  179.       fprintf (stderr, "%s:%d: ", input_filename, lineno);
  180.     else
  181. *** /Net/ohio/redbird/mself/fsf/cccp.c    Tue Jul 16 10:05:15 1991
  182. --- ./cccp.c    Fri Jul 19 13:57:50 1991
  183. ***************
  184. *** 5368,5373 ****
  185. --- 5341,5350 ----
  186.     } else {
  187.       if (if_stack->type != T_IF && if_stack->type != T_ELIF) {
  188.         error ("#elif after #else");
  189. + #ifdef REPORT_EVENT
  190. +       REPORT_EVENT (0, NULL, if_stack->fname, if_stack->lineno,
  191. +             "matching conditional", 0, 0, 0);
  192. + #endif
  193.         fprintf (stderr, " (matches line %d", if_stack->lineno);
  194.         if (if_stack->fname != NULL && ip->fname != NULL &&
  195.         strcmp (if_stack->fname, ip->nominal_fname) != 0)
  196. ***************
  197. *** 5733,5738 ****
  198. --- 5710,5719 ----
  199.   
  200.       if (if_stack->type != T_IF && if_stack->type != T_ELIF) {
  201.         error ("#else after #else");
  202. + #ifdef REPORT_EVENT
  203. +       REPORT_EVENT (0, NULL, if_stack->fname, if_stack->lineno,
  204. +             "matching conditional", 0, 0, 0);
  205. + #endif
  206.         fprintf (stderr, " (matches line %d", if_stack->lineno);
  207.         if (strcmp (if_stack->fname, ip->nominal_fname) != 0)
  208.       fprintf (stderr, ", file %s", if_stack->fname);
  209. ***************
  210. *** 6840,6845 ****
  211. --- 6818,6829 ----
  212.         break;
  213.       }
  214.   
  215. + #ifdef REPORT_EVENT
  216. +   REPORT_EVENT (0, NULL,
  217. +         ip ? ip->nominal_fname : NULL,
  218. +         ip ? ip->lineno : 0,
  219. +         msg, arg1, arg2, arg3);
  220. + #endif
  221.     if (ip != NULL)
  222.       fprintf (stderr, "%s:%d: ", ip->nominal_fname, ip->lineno);
  223.     fprintf (stderr, msg, arg1, arg2, arg3);
  224. ***************
  225. *** 6866,6871 ****
  226. --- 6848,6863 ----
  227.         break;
  228.       }
  229.   
  230. + #ifdef REPORT_EVENT
  231. +   REPORT_EVENT (0, NULL,
  232. +         ip ? ip->nominal_fname : NULL,
  233. +         ip ? ip->lineno : 0,
  234. +         "%s: %s", name,
  235. +         (errno < sys_nerr)
  236. +         ? sys_errlist[errno]
  237. +         : "undocumented I/O error",
  238. +         0);
  239. + #endif
  240.     if (ip != NULL)
  241.       fprintf (stderr, "%s:%d: ", ip->nominal_fname, ip->lineno);
  242.   
  243. ***************
  244. *** 6897,6902 ****
  245. --- 6887,6898 ----
  246.         break;
  247.       }
  248.   
  249. + #ifdef REPORT_EVENT
  250. +   REPORT_EVENT (1, NULL,
  251. +         ip ? ip->nominal_fname : NULL,
  252. +         ip ? ip->lineno : 0,
  253. +         msg, arg1, arg2, arg3);
  254. + #endif
  255.     if (ip != NULL)
  256.       fprintf (stderr, "%s:%d: ", ip->nominal_fname, ip->lineno);
  257.     fprintf (stderr, "warning: ");
  258. ***************
  259. *** 6920,6925 ****
  260. --- 6914,6924 ----
  261.         break;
  262.       }
  263.   
  264. + #ifdef REPORT_EVENT
  265. +   REPORT_EVENT (0, NULL,
  266. +         ip ? ip->nominal_fname : NULL,
  267. +         line, msg, arg1, arg2, arg3);
  268. + #endif
  269.     if (ip != NULL)
  270.       fprintf (stderr, "%s:%d: ", ip->nominal_fname, line);
  271.     fprintf (stderr, msg, arg1, arg2, arg3);
  272. ***************
  273. *** 6949,6954 ****
  274. --- 6948,6957 ----
  275.        char *msg;
  276.   {
  277.     int i;
  278. + #ifdef REPORT_EVENT
  279. +   REPORT_EVENT (pedantic_errors ? 0 : 1,
  280. +         NULL, file, line, msg, arg1, arg2, arg3);
  281. + #endif
  282.     if (file != NULL)
  283.       fprintf (stderr, "%s:%d: ", file, line);
  284.     if (!pedantic_errors)
  285. ***************
  286. *** 7679,7684 ****
  287. --- 7634,7642 ----
  288.   fatal (str, arg)
  289.        char *str, *arg;
  290.   {
  291. + #ifdef REPORT_EVENT
  292. +   REPORT_EVENT (0, progname, NULL, 0, str, arg, 0, 0);
  293. + #endif
  294.     fprintf (stderr, "%s: ", progname);
  295.     fprintf (stderr, str, arg);
  296.     fprintf (stderr, "\n");
  297. *** /Net/ohio/redbird/mself/fsf/gcc.c    Mon Jul  8 11:12:08 1991
  298. --- ./gcc.c    Thu Jul 18 17:02:28 1991
  299. ***************
  300. *** 1708,1714 ****
  301.   
  302.       if (argbuf_index > 0)
  303.         {
  304. !         int value = execute ();
  305.           if (value)
  306.             return value;
  307.         }
  308. --- 1719,1731 ----
  309.   
  310.       if (argbuf_index > 0)
  311.         {
  312. !         int value;
  313. ! #ifdef REPORT_EVENT
  314. !         if (spec == link_command_spec)
  315. !           REPORT_EVENT (-1, NULL, NULL, 0, "Linking", 0, 0, 0);
  316. ! #endif
  317. !         value = execute ();
  318.           if (value)
  319.             return value;
  320.         }
  321. ***************
  322. *** 2341,2346 ****
  323. --- 2358,2366 ----
  324.         else
  325.           input_suffix = "";
  326.   
  327. + #ifdef REPORT_EVENT
  328. +       REPORT_EVENT (-1, NULL, input_basename, 0, "Compiling", 0, 0, 0);
  329. + #endif
  330.         value = do_spec (cp->spec);
  331.         if (value < 0)
  332.           this_file_error = 1;
  333.