PIPS
bootstrap.c
Go to the documentation of this file.
1 /*
2 
3  $Id: bootstrap.c 23495 2018-10-24 09:19:47Z coelho $
4 
5  Copyright 1989-2016 MINES ParisTech
6 
7  This file is part of PIPS.
8 
9  PIPS is free software: you can redistribute it and/or modify it
10  under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  any later version.
13 
14  PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
15  WARRANTY; without even the implied warranty of MERCHANTABILITY or
16  FITNESS FOR A PARTICULAR PURPOSE.
17 
18  See the GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with PIPS. If not, see <http://www.gnu.org/licenses/>.
22 
23 */
24 #ifdef HAVE_CONFIG_H
25  #include "pips_config.h"
26 #endif
27 /*
28  Symbol table initialization with Fortran operators, commands and
29  intrinsics
30 
31  More information is provided in effects/effects.c
32 
33  Remi Triolet
34 
35  Modifications :
36  ---------------
37  - add intrinsics according to Fortran standard Table 5, pp. 15.22-15-25,
38  Francois Irigoin, 02/06/90
39  - add .SEQ. to handle ranges outside of arrays [pj]
40  - add intrinsic DFLOAT. bc. 13/1/96.
41  - add pseudo-intrinsics SUBSTR and ASSIGN_SUBSTR to handle strings,
42  FI, 25/12/96
43  - Fortran specification conformant typing of expressions...
44 
45  Molka Becher (MB), June 2010
46  - Check of C intrinsics already added
47  - Add of missing C intrinsics according to ISO/IEC 9899:TC2
48  - Add of functions handling long double type and long double complex type
49 
50  Molka Becher (MB), June 2010
51  - Check of C intrinsics already added
52  - Add of missing C intrinsics according to ISO/IEC 9899:TC2
53  - Add of functions handling long double type and long double complex type
54 
55 
56  Bugs:
57  -----
58  - intrinsics are not properly typed
59 
60 */
61 
62 #include <stdio.h>
63 #include <string.h>
64 #include <limits.h>
65 #include <stdlib.h>
66 
67 #include "linear.h"
68 
69 #include "genC.h"
70 #include "ri.h"
71 #include "ri-util.h"
72 #include "database.h"
73 
74 #include "bootstrap.h"
75 
76 #include "misc.h"
77 #include "pipsdbm.h"
78 #include "parser_private.h"
79 #include "constants.h"
80 #include "resources.h"
81 
82 #include "properties.h"
83 
84 #define LOCAL static
85 #undef make_entity
86 
87 /* Working with hash_table of basic
88  */
89 #define GET_TYPE(h, e) ((basic)hash_get(h, (char*)(e)))
90 #define PUT_TYPE(h, e, b) hash_put(h, (char*)(e), (char*)(b))
91 
92 /* Function in type_checker.c */
93 extern expression
95 extern expression
96 cast_constant(expression exp_constant, basic to_basic,
98 extern bool
100 extern void
102 
103 
105 {
112 
113 
120 }
121 
122 static void CreateLogicalUnits()
123 {
124  /* First a dummy function - close to C one "crt0()" - in order to
125  - link the next entity to its ram
126  - make an unbounded dimension for this entity
127  */
128 
129  entity ent = entity_undefined;
130  entity luns = entity_undefined;
133 
134  code_initializations(c) = s;
135 
140  NIL))),
144 
146 
153 
154  /* GO: entity for io logical units: It is an array which*/
158  CONS(DIMENSION,
160  (int_to_expression(0),
161  /*
162  MakeNullaryCall
163  (CreateIntrinsic(UNBOUNDED_DIMENSION_NAME))
164  */
165  int_to_expression(2000),
166  NIL),
167  NIL)),
168  /* make_storage(is_storage_ram,
169  make_ram(entity_undefined, DynamicArea, 0, NIL))
170  */
172  make_ram(ent,
175  0, NIL)),
178 
179  /* GO: entity for io logical units: It is an array which*/
183  CONS(DIMENSION,
185  (int_to_expression(0),
186  /*
187  MakeNullaryCall
188  (CreateIntrinsic(UNBOUNDED_DIMENSION_NAME))
189  */
190  int_to_expression(2000),
191  NIL),
192  NIL)),
193  /* make_storage(is_storage_ram,
194  make_ram(entity_undefined, DynamicArea, 0, NIL))
195  */
197  make_ram(ent,
200  0, NIL)),
203 
204  /* GO: entity for io logical units: It is an array which*/
208  CONS(DIMENSION,
210  (int_to_expression(0),
211  /*
212  * MakeNullaryCall
213  * (CreateIntrinsic(UNBOUNDED_DIMENSION_NAME))
214  */
215  int_to_expression(2000),
216  NIL),
217  NIL)),
218  /* make_storage(is_storage_ram,
219  * make_ram(entity_undefined, DynamicArea, 0, NIL))
220  */
222  make_ram(ent,
225  0, NIL)),
228 
231 }
232 
233 /* added to handle xxxrandxxx functions. Amira Mensi and then
234  generalized for other hidden libc variables
235 */
236 static entity CreateAbstractStateVariable(string pn, string vn)
237 {
238  /* First a dummy function - close to C one "crt0()" - in order to
239  - link the next entity to its ram
240  - make an unbounded dimension for this entity
241  */
242 
247 
248  code_initializations(c) = s;
249 
250  if(entity_undefined_p(ent)) {
252  pn),
255  NIL))),
259 
261 
268  }
269  else
271 
272  /* entity for random seed or other abstract states like heap: It is
273  an unsigned int. */
274  as = make_entity(AddPackageToName(pn, vn),
276  /* make_storage(is_storage_ram,
277  make_ram(entity_undefined, DynamicArea, 0, NIL))
278  */
280  make_ram(ent,
281  FindEntity(pn,
283  0, NIL)),
286 
288  return as;
289 }
290 
291 // added to handle xxxrandxxx functions.Amira Mensi
292 static void CreateRandomSeed()
293 {
294  entity as =
296  //add_thread_safe_variable(as);
298 }
299 // added to handle time functions
300 static void CreateTimeSeed()
301 {
302  entity as =
305  entity asb =
308 }
309 
311 {
312  entity as =
314 
317 }
318 //Molka Becher : Added to handle Memmove function.
320 {
321  entity as =
323 
326 }
327 ␌
328 static list
329 make_parameter_list(int n, parameter (* mkprm)(void))
330 {
331  list l = NIL;
332 
333  if (n < (INT_MAX))
334  {
335  int i = n;
336  while (i-- > 0)
337  {
338  l = CONS(PARAMETER, mkprm(), l);
339  }
340  }
341  else
342  {
343  /* varargs */
344  parameter p = mkprm();
345  type pt = copy_type(parameter_type(p));
346  type v = make_type(is_type_varargs, pt);
348 
349  l = CONS(PARAMETER, vp, l);
350  free_parameter(p);
351  }
352  return l;
353 }
354 
355 /* The default intrinsic type is a functional type with n overloaded
356  * arguments returning an overloaded result if the arity is known.
357  * If the arity is unknown, the default intrinsic type is a 0-ary
358  * functional type returning an overloaded result.
359  */
360 
361 static type
363 {
364  type t = type_undefined;
366 
368  t = make_type(is_type_functional, ft);
369 
372  return t;
373 }
374 
375 static type
377 {
378  type t = type_undefined;
380 
384  t = make_type(is_type_functional, ft);
385 
386  return t;
387 }
388 
389 static type
391 {
392  type t = type_undefined;
394 
398  t = make_type(is_type_functional, ft);
399 
400  return t;
401 }
402 
403 static type
405 {
406  type t = type_undefined;
408 
412  t = make_type(is_type_functional, ft);
413 
414  return t;
415 }
416 
417 static type
419 {
420  type t = type_undefined;
422 
426  t = make_type(is_type_functional, ft);
427 
428  return t;
429 }
430 
431 static type
433 {
434  type t = type_undefined;
436 
440  t = make_type(is_type_functional, ft);
441 
442  return t;
443 }
444 
445 static type
447 {
448  type t = type_undefined;
450 
454  t = make_type(is_type_functional, ft);
455 
456  return t;
457 }
458 
459 //static type
460 //overloaded_to_longdoublecomplex_type(int n) /* MB */
461 /*{
462  type t = type_undefined;
463  functional ft = functional_undefined;
464 
465  ft = make_functional(NIL, MakeLongDoublecomplexResult());
466  functional_parameters(ft) =
467  make_parameter_list(n, MakeOverloadedParameter);
468  t = make_type(is_type_functional, ft);
469 
470  return t;
471 }*/
472 
473 static type
475 {
476  type t = type_undefined;
478 
482  t = make_type(is_type_functional, ft);
483 
484  return t;
485 }
486 
487 /* to handle BTEST function which takes integer as parameter and
488  returns logical. Amira Mensi */
489 static type
491 {
492  type t = type_undefined;
494 
498  t = make_type(is_type_functional, ft);
499 
500  return t;
501 }
502 
503 /* Why do we make these functions static and keep them here instead of
504  populating ri-util/type.c? */
506 {
507  type t = type_undefined;
509 
513  t = make_type(is_type_functional, ft);
514 
515  return t;
516 }
518 {
519  type t = type_undefined;
521 
525  t = make_type(is_type_functional, ft);
526 
527  return t;
528 }
529 
530 /* Can be used for C or Fortran functions. E.g. abort() */
531 static type void_to_void_type(int n __attribute__ ((unused)))
532 {
533  type t = type_undefined;
535 
539  make_mode_value(), // not
540  // significant
541  // for void...
542  make_dummy_unknown()), NIL);
543  t = make_type(is_type_functional, ft);
544 
545  pips_assert("t is consistent", type_consistent_p(t));
546 
547  return t;
548 }
549 
550 /* C only because of pointer. e.g. atexit() */
552 {
553  type t = type_undefined;
555  type vtv = void_to_void_type(0);
556  type vtvp = type_to_pointer_type(vtv);
557 
561  make_mode_value(), // not
562  // significant
563  // for void...
564  make_dummy_unknown()), NIL);
565  t = make_type(is_type_functional, ft);
566 
567  pips_assert("t is consistent", type_consistent_p(t));
568 
569  return t;
570 }
571 
572 /* C only because of pointer. e.g. atof() */
574 {
575  type t = type_undefined;
578  //type cp = type_to_pointer_type(c);
580 
583 
584  ft = make_functional(NIL, d);
587  make_mode_value(), // not
588  // significant
589  // for void...
590  make_dummy_unknown()), NIL);
591  t = make_type(is_type_functional, ft);
592 
593  pips_assert("t is consistent", type_consistent_p(t));
594 
595  return t;
596 }
597 
599 {
600  type t = type_undefined;
602 
605  t = make_type(is_type_functional, ft);
606 
607  return t;
608 }
609 
610 /*
611 static type
612 integer_to_double_type(int n)
613 {
614  type t = type_undefined;
615  functional ft = functional_undefined;
616 
617  ft = make_functional(NIL, MakeDoubleprecisionResult());
618  functional_parameters(ft) = make_parameter_list(n, MakeIntegerParameter);
619  t = make_type(is_type_functional, ft);
620 
621  return t;
622 }
623 */
624 
625 static type
627 {
628  type t = type_undefined;
630 
633  t = make_type(is_type_functional, ft);
634 
635  return t;
636 }
637 
638 static type
640 {
641  type t = type_undefined;
643 
646  t = make_type(is_type_functional, ft);
647 
648  return t;
649 }
650 
651 static type
653 {
654  type t = type_undefined;
656 
659  t = make_type(is_type_functional, ft);
660 
661  return t;
662 }
663 
664 static type
666 {
667  type t = type_undefined;
669 
672  t = make_type(is_type_functional, ft);
673 
674  return t;
675 }
676 
677 static type
679 {
680  type t = type_undefined;
682 
685  t = make_type(is_type_functional, ft);
686 
687  return t;
688 }
689 
690 static type
692 {
693  type t = type_undefined;
695 
699  t = make_type(is_type_functional, ft);
700 
701  return t;
702 }
703 
704 static type
706 {
707  type t = type_undefined;
709 
713  t = make_type(is_type_functional, ft);
714 
715  return t;
716 }
717 
718 static type
720 {
721  type t = type_undefined;
723 
727  t = make_type(is_type_functional, ft);
728 
729  return t;
730 }
731 
732 static type
734 {
735  type t = type_undefined;
737 
741  t = make_type(is_type_functional, ft);
742 
743  return t;
744 }
745 
746 static type
748 {
749  type t = type_undefined;
751 
755  t = make_type(is_type_functional, ft);
756 
757  return t;
758 }
759 
760 /*
761 static type
762 double_to_real_type(int n)
763 {
764  type t = type_undefined;
765  functional ft = functional_undefined;
766 
767  ft = make_functional(NIL, MakeRealResult());
768  functional_parameters(ft) =
769  make_parameter_list(n, MakeDoubleprecisionParameter);
770  // t = make_type(is_type_functional, ft);
771 
772  return t;
773 }
774 */
775 
776 static type
778 {
779  type t = type_undefined;
781 
785  t = make_type(is_type_functional, ft);
786 
787  return t;
788 }
789 
790 static type
792 {
793  type t = type_undefined;
795 
799  t = make_type(is_type_functional, ft);
800 
801  return t;
802 }
803 
804 static type
806 {
807  type t = type_undefined;
809 
813  t = make_type(is_type_functional, ft);
814 
815  return t;
816 }
817 
818 static type
820 {
821  type t = type_undefined;
823 
827  t = make_type(is_type_functional, ft);
828 
829  return t;
830 }
831 
832 
833 static type
835 {
836  type t = type_undefined;
838 
842  t = make_type(is_type_functional, ft);
843 
844  return t;
845 }
846 
847 
848 static type
850 {
851  type t = type_undefined;
853 
856  t = make_type(is_type_functional, ft);
857 
858  return t;
859 }
860 
861 static type
863 {
864  type t = type_undefined;
866 
870  t = make_type(is_type_functional, ft);
871 
872  return t;
873 }
874 
875 static type
877 {
878  type t = type_undefined;
880 
883  t = make_type(is_type_functional, ft);
884 
885  return t;
886 }
887 
888 static type
890 {
891  type t = type_undefined;
893 
897  t = make_type(is_type_functional, ft);
898 
899  return t;
900 }
901 
902 static type
904 {
905  type t = type_undefined;
907 
911  t = make_type(is_type_functional, ft);
912 
913  return t;
914 }
915 
916 static type
918 {
919  type t = type_undefined;
921 
925  t = make_type(is_type_functional, ft);
926 
927  return t;
928 }
929 
930 static type
932 {
933  type t = type_undefined;
935 
939  t = make_type(is_type_functional, ft);
940 
941  return t;
942 }
943 
944 static type
946 {
947  type t = type_undefined;
949 
953  t = make_type(is_type_functional, ft);
954 
955  return t;
956 }
957 
958 static type
960 {
961  type t = type_undefined;
963 
967  t = make_type(is_type_functional, ft);
968 
969  return t;
970 }
971 
972 static type
974 {
975  type t = type_undefined;
977 
987  t = make_type(is_type_functional, ft);
988 
989  pips_assert("valid arity", (int)gen_length(functional_parameters(ft))==n);
990 
991  return t;
992 }
993 
994 static type
996 {
997  type t = type_undefined;
999 
1001  functional_parameters(ft) =
1003  functional_parameters(ft) =
1005  functional_parameters(ft));
1006  functional_parameters(ft) =
1008  functional_parameters(ft));
1009  functional_parameters(ft) =
1011  functional_parameters(ft));
1012  t = make_type(is_type_functional, ft);
1013 
1014  pips_assert("valid arity", (int)gen_length(functional_parameters(ft))==n);
1015 
1016  return t;
1017 }
1018 
1019 static type
1021 {
1022  type t = type_undefined;
1024 
1027  t = make_type(is_type_functional, ft);
1028 
1029  return t;
1030 }
1031 
1032 /***************************** TYPE A CALL FUNCTIONS **********************/
1033 
1034 /*****************************************************************************
1035  * Typing range of loop to the type of index loop.
1036  * This range is already verified
1037  */
1039 {
1040  basic lower, upper, incr;
1041  lower = GET_TYPE(context->types, range_lower(r));
1042  upper = GET_TYPE(context->types, range_upper(r));
1043  incr = GET_TYPE(context->types, range_increment(r));
1044 
1045  if(!basic_equal_p(index, lower))
1046  {
1047  range_lower(r) = insert_cast(index, lower, range_lower(r), context);
1048  }
1049  if(!basic_equal_p(index, upper))
1050  {
1051  range_upper(r) = insert_cast(index, upper, range_upper(r), context);
1052  }
1053  if(!basic_equal_p(index, incr))
1054  {
1055  range_increment(r) = insert_cast(index, incr, range_increment(r), context);
1056  }
1057 }
1058 
1059 /**************************************************************************
1060  * Convert a constant from INT to REAL
1061  * e.g: REAL(10) --> 10.0
1062  */
1064 {
1065  char s[255];
1066  strcpy(s, entity_local_name(call_function(c)));
1067  strcat(s,".0E0");
1068  return make_call(make_constant_entity((string)s,
1070  NIL);
1071 }
1072 /* INT -> DOUBLE
1073  * e.g: DBLE(10) => 10.0
1074  */
1076 {
1077  char s[255];
1078  strcpy(s, entity_local_name(call_function(c)));
1079  strcat(s,".0D0");
1080  return make_call(make_constant_entity((string)s,
1082  NIL);
1083 }
1084 /* REAL -> INT
1085  * e.g: INT(-5.9E2) => -590
1086  */
1088 {
1089  long l;
1090  float r;
1091  char s[255];
1092  sscanf(entity_local_name(call_function(c)), "%f",&r);
1093  l = (long)r;
1094  sprintf(s, "%ld", l);
1096  NIL);
1097 }
1098 /* REAL -> DOUBLE
1099  * e.g: DBLE(-5.9E-2) => -5.9D-2
1100  */
1102 {
1103  char s[255];
1104  int i, len;
1105  strcpy(s, entity_local_name(call_function(c)));
1106  len = strlen(s);
1107  for(i = 0; i < len; i++)
1108  {
1109  if (s[i]=='E' || s[i]=='e')
1110  {
1111  s[i]='D';
1112  break;
1113  }
1114  }
1115  /* There is not E, e.g: 5.496 */
1116  if (i == len)
1117  {
1118  strcat(s,"D0");
1119  }
1120  return make_call(make_constant_entity((string)s,
1122  NIL);
1123 }
1124 /* DOUBLE -> REAL
1125  * e.g: REAL(-5.9D-2) => -5.9E-2
1126  */
1128 {
1129  char s[255];
1130  int i, len;
1131  strcpy(s, entity_local_name(call_function(c)));
1132  len = strlen(s);
1133  for(i = 0; i < len; i++)
1134  {
1135  if (s[i]=='D' || s[i]=='d')
1136  {
1137  s[i]='E';
1138  break;
1139  }
1140  }
1141  /* There is not D, e.g: 5.496 */
1142  if (i == len)
1143  {
1144  strcat(s,"E0");
1145  }
1146  return make_call(make_constant_entity((string)s,
1148  NIL);
1149 }
1150 /* DOUBLE -> INT
1151  * e.g: INT(-5.9D2) => -590
1152  */
1154 {
1155  call c_result, c_real = convert_constant_from_double_to_real(c);
1156  c_result = convert_constant_from_real_to_int(c_real);
1157  free_call(c_real);
1158  return c_result;
1159 }
1160 /* REAL -> COMPLEX
1161  * e.g: CMPLX(-5.9E5) => (-5.9E5, 0.0)
1162  */
1164 {
1165  expression exp_real, exp_imag;
1166  call c_imag;
1167  list args;
1170  c_imag = make_call(make_constant_entity("0.0E0",
1172  NIL);
1173  exp_imag = make_expression(make_syntax(is_syntax_call, c_imag),
1175  args = CONS(EXPRESSION, exp_real, CONS(EXPRESSION, exp_imag, NIL));
1176  /* Conversion explicit */
1177  if (get_bool_property("TYPE_CHECKER_EXPLICIT_COMPLEX_CONSTANTS"))
1178  {
1180  }
1181  /* Conversion inplicit */
1183 }
1184 /* DOUBLE -> COMPLEX
1185  * e.g: CMPLX(-5.9D5) => (-5.9E5, 0.0)
1186  */
1188 {
1189  call c_result, c_real = convert_constant_from_double_to_real(c);
1190  c_result = convert_constant_from_real_to_complex(c_real);
1191  free_call(c_real);
1192  return c_result;
1193 }
1194 /* INT -> COMPLEX
1195  * e.g: CMPLX(-5) => (-5.0, 0.0)
1196  */
1198 {
1199  call c_result, c_real = convert_constant_from_int_to_real(c);
1200  c_result = convert_constant_from_real_to_complex(c_real);
1201  free_call(c_real);
1202  return c_result;
1203 }
1204 /* DOUBLE -> DCOMPLEX
1205  * e.g: DCMPLX(-5.9D5) => (-5.9D5, 0.0)
1206  */
1208 {
1209  expression exp_real, exp_imag;
1210  call c_imag;
1211  list args;
1214  c_imag = make_call(make_constant_entity("0.0D0",
1216  NIL);
1217  exp_imag = make_expression(make_syntax(is_syntax_call, c_imag),
1219  args = CONS(EXPRESSION, exp_real, CONS(EXPRESSION, exp_imag, NIL));
1220 
1221  /* Conversion explicit */
1222  if (get_bool_property("TYPE_CHECKER_EXPLICIT_COMPLEX_CONSTANTS"))
1223  {
1225  }
1226  /* Conversion inplicit */
1228 }
1229 /* REAL -> DCOMPLEX
1230  * e.g: DCMPLX(-5.9E5) => (-5.9D5, 0.0D0)
1231  */
1233 {
1234  call c_result, c_double = convert_constant_from_real_to_double(c);
1235  c_result = convert_constant_from_double_to_dcomplex(c_double);
1236  free_call(c_double);
1237  return c_result;
1238 }
1239 /* INT -> DCOMPLEX
1240  * e.g: DCMPLX(-5) => (-5D0, 0.0D0)
1241  */
1243 {
1244  call c_result, c_double = convert_constant_from_int_to_double(c);
1245  c_result = convert_constant_from_double_to_dcomplex(c_double);
1246  free_call(c_double);
1247  return c_result;
1248 }
1249 
1250 /*****************************************************************************
1251  * Convert constant C to basic naming to_basic
1252  */
1254 {
1255  basic b;
1256  entity function_called = call_function(c);
1257  if(entity_constant_p(function_called))
1258  {
1259  b = entity_basic(function_called);
1260  if(basic_equal_p(b, to_basic))
1261  {
1262  //return NULL;
1263  return copy_call(c);
1264  }
1265  else if (basic_int_p(b))
1266  {
1267  /* INT -> REAL */
1268  if (basic_float_p(to_basic) && basic_float(to_basic)==4)
1269  {
1271  }
1272  /* INT -> DOUBLE */
1273  if (basic_float_p(to_basic) && basic_float(to_basic)==8)
1274  {
1276  }
1277  /* INT -> COMPLEX */
1278  if (basic_complex_p(to_basic) && basic_complex(to_basic)==8)
1279  {
1281  }
1282  /* INT -> DCOMPLEX */
1283  if (basic_complex_p(to_basic) && basic_complex(to_basic)==16)
1284  {
1286  }
1287  }
1288  else if (basic_float_p(b) && basic_float(b)==4)
1289  {
1290  /* REAL -> INT */
1291  if (basic_int_p(to_basic))
1292  {
1294  }
1295  /* REAL -> DOUBLE */
1296  else if (basic_float_p(to_basic) && basic_float(to_basic)==8)
1297  {
1299  }
1300  /* REAL -> COMPLEX */
1301  else if (basic_complex_p(to_basic) && basic_complex(to_basic)==8)
1302  {
1304  }
1305  /* REAL -> DCOMPLEX */
1306  else if (basic_complex_p(to_basic) && basic_complex(to_basic)==16)
1307  {
1309  }
1310  }
1311  else if (basic_float_p(b) && basic_float(b)==8)
1312  {
1313  /* DOUBLE -> INT */
1314  if (basic_int_p(to_basic))
1315  {
1317  }
1318  /* DOUBLE -> REAL */
1319  else if (basic_float_p(to_basic) && basic_float(to_basic)==4)
1320  {
1322  }
1323  /* DOUBLE -> COMPLEX */
1324  else if (basic_complex_p(to_basic) && basic_complex(to_basic)==8)
1325  {
1327  }
1328  /* DOUBLE -> DCOMPLEX */
1329  else if (basic_complex_p(to_basic) && basic_complex(to_basic)==16)
1330  {
1332  }
1333  }
1334  }
1335  return NULL;
1336 }
1337 
1338 /*****************************************************************************
1339  * Cast an expression constant to the basic to_basic.
1340  * Return true if OK
1341  */
1342 expression
1344 {
1345  entity function_called;
1346  call c;
1347  basic b = NULL;
1348  expression exp, exp_real, exp_imag, exp_real2, exp_imag2;
1349  syntax s = expression_syntax(exp_constant);
1350  if(syntax_call_p(s))
1351  {
1352  function_called = call_function(syntax_call(s));
1353  if(entity_constant_p(function_called))
1354  {
1355  /* Convert if necessary */
1356  c = convert_constant(syntax_call(s), to_basic);
1357  if (c != NULL)
1358  {
1359  context->number_of_simplication++;
1362  }
1363  }
1364  else if(ENTITY_UNARY_MINUS_P(function_called))
1365  {
1367  to_basic, context);
1368  if (exp != NULL)
1369  {
1370  c = make_call(copy_entity(function_called),
1371  CONS(EXPRESSION, exp, NIL));
1374  }
1375  }
1376  else if(ENTITY_IMPLIED_CMPLX_P(function_called) ||
1377  ENTITY_CONVERSION_CMPLX_P(function_called) ||
1378  ENTITY_IMPLIED_DCMPLX_P(function_called) ||
1379  ENTITY_CONVERSION_DCMPLX_P(function_called))
1380  {
1381  exp_real = EXPRESSION(CAR(call_arguments(syntax_call(s))));
1382  /* Two arguments, with imagine party */
1383  if (CDR(call_arguments(syntax_call(s))) != NIL )
1384  {
1385  exp_imag = EXPRESSION(CAR(CDR(call_arguments(syntax_call(s)))));
1386  }
1387  /* One argument, no imagine party */
1388  else
1389  {
1390  exp_imag = NULL;
1391  }
1392  if (!basic_complex_p(to_basic))
1393  {
1394  return cast_constant(exp_real, to_basic, context);
1395  }
1396  /* DCOMPLEX -> COMPLEX */
1397  else if (basic_complex(to_basic) == 8 &&
1398  (ENTITY_IMPLIED_DCMPLX_P(function_called) ||
1399  ENTITY_CONVERSION_DCMPLX_P(function_called)))
1400  {
1401  b = make_basic_float(4);
1402  if ((exp_real2 = cast_constant(exp_real, b, context)) == NULL)
1403  {
1404  exp_real2 = exp_real;
1405  }
1406 
1407  if (exp_imag != NULL)
1408  {
1409  if ((exp_imag2 = cast_constant(exp_imag, b, context)) == NULL)
1410  {
1411  exp_imag2 = exp_imag;
1412  }
1413  }
1414  else
1415  {
1417  REAL_LENGTH),
1418  NIL);
1419  exp_imag2 = make_expression(make_syntax(is_syntax_call, c),
1421  }
1422  /* Conversion implicit */
1423  if (!get_bool_property("TYPE_CHECKER_EXPLICIT_COMPLEX_CONSTANTS") &&
1424  ENTITY_IMPLIED_DCMPLX_P(function_called))
1425  {
1427  CONS(EXPRESSION, exp_real2,
1428  CONS(EXPRESSION, exp_imag2, NIL)));
1429  }
1430  /* Conversion explicit */
1431  else
1432  {
1434  CONS(EXPRESSION, exp_real2,
1435  CONS(EXPRESSION, exp_imag2, NIL)));
1436  }
1439  }
1440  /* COMPLEX -> DCOMPLEX */
1441  else if (basic_complex(to_basic) == 16 &&
1442  (ENTITY_IMPLIED_CMPLX_P(function_called) ||
1443  ENTITY_CONVERSION_CMPLX_P(function_called)))
1444  {
1445  b = make_basic_float(8);
1446  if ((exp_real2 = cast_constant(exp_real, b, context)) == NULL)
1447  {
1448  exp_real2 = exp_real;
1449  }
1450  if (exp_imag != NULL)
1451  {
1452  if ((exp_imag2 = cast_constant(exp_imag, b, context)) == NULL)
1453  {
1454  exp_imag2 = exp_imag;
1455  }
1456  }
1457  else
1458  {
1460  DOUBLE_LENGTH),
1461  NIL);
1462  exp_imag2 = make_expression(make_syntax(is_syntax_call, c),
1464  }
1465  /* Conversion implicit */
1466  if (!get_bool_property("TYPE_CHECKER_EXPLICIT_COMPLEX_CONSTANTS") &&
1467  ENTITY_IMPLIED_CMPLX_P(function_called))
1468  {
1470  CONS(EXPRESSION, exp_real2,
1471  CONS(EXPRESSION, exp_imag2, NIL)));
1472  }
1473  /* Conversion explicit */
1474  else
1475  {
1477  CONS(EXPRESSION, exp_real2,
1478  CONS(EXPRESSION, exp_imag2, NIL)));
1479  }
1482  }
1483  }
1484  }
1485  if (b != NULL)
1486  {
1487  free_basic(b);
1488  }
1489  return NULL;
1490 }
1491 /*****************************************************************************
1492  * Specify a cast for converting from a basic ('from') to another basic (cast)
1493  */
1494 static entity
1496 {
1497  switch (basic_tag(cast))
1498  {
1499  case is_basic_int:
1500  if (from!=NULL && from!=basic_undefined && basic_string_p(from))
1501  {
1503  }
1504  else
1505  {
1506  switch(basic_int(cast))
1507  {
1508  case 2:
1509  case 4:
1510  case 8:
1512  default:
1513  pips_internal_error("Unexpected integer size %d", basic_int(cast));
1514  }
1515  }
1516  break;
1517  case is_basic_float:
1518  switch(basic_float(cast))
1519  {
1520  case 4:
1522  case 8:
1524  default:
1525  pips_internal_error("Unexpected float size %d", basic_float(cast));
1526  }
1527  break;
1528  case is_basic_logical:
1529  switch(basic_logical(cast))
1530  {
1531  case 1:
1532  case 2:
1533  case 4:
1534  case 8:
1535  return entity_undefined;
1536  default:
1537  pips_internal_error("Unexpected logical size %d", basic_logical(cast));
1538  }
1539  break;
1540  case is_basic_complex:
1541  switch(basic_complex(cast))
1542  {
1543  case 8:
1545  case 16:
1547  default:
1548  pips_internal_error("Unexpected complex size %d", basic_complex(cast));
1549  }
1550  break;
1551  case is_basic_string:
1553  case is_basic_overloaded:
1554  pips_internal_error("Should never convert to overloaded...");
1555  default:
1556  pips_internal_error("Unexpected basic tag (%d)", basic_tag(cast));
1557  }
1558 
1559  return NULL;
1560 }
1561 
1562 /*****************************************************************************
1563  * Cast an expression
1564  * e.g: x --> INT(x)
1565  */
1566 expression
1568 {
1569  call c;
1570  syntax s;
1571  entity cast_function;
1572  expression exp_constant;
1573 
1574  s = expression_syntax(exp);
1575 
1576  /* If exp is a constant -> Convert it
1577  * e.g: 5.9 -> 5 (REAL -> INT)
1578  */
1579  if ((exp_constant = cast_constant(exp, cast, context)) != NULL)
1580  {
1581  return exp_constant;
1582  }
1583 
1584  /* If not */
1585  cast_function = get_cast_function_for_basic(cast, from);
1586  if (cast_function == NULL)
1587  {
1588  pips_internal_error("Cast function is not verified!");
1589  }
1590  if (cast_function == entity_undefined)
1591  {
1592  pips_internal_error("Can not convert to LOGICAL!");
1593  }
1594  c = make_call(cast_function, CONS(EXPRESSION, exp, NIL));
1595  s = make_syntax(is_syntax_call, c);
1596 
1597  /* Count the number of conversions */
1598  context->number_of_conversion++;
1599 
1601 }
1602 
1603 /* Type check double complex? */
1604 
1605 #define TC_DCOMPLEX \
1606 get_bool_property("TYPE_CHECKER_DOUBLE_COMPLEX_EXTENSION")
1607 
1608 /* MB : Type check long double complex */
1609 #define TC_LONGDCOMPLEX \
1610 get_bool_property("TYPE_CHECKER_LONG_DOUBLE_COMPLEX_EXTENSION")
1611 
1612 /* Determine the longest basic among the arguments of c
1613  */
1614 static basic
1616 {
1618 
1619  MAP(EXPRESSION, e,
1620  {
1621  if (b1==basic_undefined)
1622  {
1623  /* first time */
1624  b1 = GET_TYPE(types, e);
1625  }
1626  else
1627  {
1628  /* after first argument */
1629  b2 = GET_TYPE(types, e);
1630  if (is_inferior_basic(b1, b2))
1631  b1 = b2;
1632  }
1633  },
1634  call_arguments(c));
1635 
1636  return b1==basic_undefined? b1: copy_basic(b1);
1637 }
1638 
1639 /************* CHECK THE VALIDE OF ARGUMENTS BASIC OF FUNCTION ************/
1640 /* Verify if all the arguments basic of function C are INTEGER
1641  * If there is no argument, I return TRUE
1642  */
1643 static bool
1644 check_if_basics_ok(list le, hash_table types, bool(*basic_ok)(basic))
1645 {
1646  MAP(EXPRESSION, e,
1647  {
1648  if (!basic_ok(GET_TYPE(types, e)))
1649  {
1650  return false;
1651  }
1652  }
1653  , le);
1654 
1655  return true;
1656 }
1657 
1658 static bool
1660 {
1661  return basic_int_p(b) && basic_int(b)==4;
1662 }
1663 static bool
1665 {
1666  return basic_int_p(b) && basic_int(b)==6;
1667 }
1668 static bool
1670 {
1671  return basic_int_p(b) && basic_int(b)==8;
1672 }
1673 static bool
1675 {
1676  return basic_float_p(b) && basic_float(b)==4;
1677 }
1678 static bool
1680 {
1681  return basic_float_p(b) && basic_float(b)==8;
1682 }
1683 static bool
1685 {
1686  return basic_float_p(b) && basic_float(b)==16;
1687 }
1688 static bool
1690 {
1691  return basic_complex_p(b) && basic_complex(b)==8;
1692 }
1693 static bool
1695 {
1696  return basic_complex_p(b) && basic_complex(b)==16;
1697 }
1698 static bool
1700 {
1701  return basic_complex_p(b) && basic_complex(b)==32;
1702 }
1703 
1704 static bool
1706 {
1708 }
1709 static bool
1711 {
1713 }
1714 static bool
1716 {
1718 }
1719 
1720 static bool
1722 {
1724 }
1725 static bool
1727 {
1729 }
1730 static bool
1732 {
1734 }
1735 static bool
1737 {
1739 }
1740 static bool
1742 {
1744 }
1745 static bool
1747 {
1749 }
1750 
1751 
1752 /**************************************************************************
1753  * Verify if all the arguments basic of function C
1754  * If there is no argument, I return TRUE
1755  *
1756  * Note: I - Integer; R - Real; D - Double; C - Complex;
1757  */
1758 
1759 /* Molka Becher: add of long int, long long int, long double and long
1760  double complex types */
1761 static bool
1763  call c,
1765  bool integer_ok,
1766  bool longinteger_ok,
1767  bool longlonginteger_ok,
1768  bool real_ok,
1769  bool double_ok,
1770  bool longdouble_ok,
1771  bool complex_ok,
1772  bool dcomplex_ok,
1773  bool longdcomplex_ok,
1774  bool logical_ok,
1775  bool character_ok)
1776 {
1777  basic b;
1778  int argnumber = 0;
1779  bool
1780  okay = true,
1781  arg_double = false,
1782  arg_cmplx = false;
1783 
1784  list args = call_arguments(c);
1785 
1786  FOREACH(EXPRESSION, e, args)
1787  {
1788  argnumber++;
1789 
1790  pips_assert("type is defined", hash_defined_p(context->types, e));
1791 
1792  b = GET_TYPE(context->types, e);
1793 
1794  /* Subroutine maybe be used as a function */
1795  if (basic_overloaded_p(b))
1796  {
1797  syntax s = expression_syntax(e);
1798  const char* what ;
1799  switch (syntax_tag(s)) {
1800  case is_syntax_call:
1802  break;
1803  case is_syntax_reference:
1805  break;
1806  case is_syntax_range:
1807  what = "**RANGE**";
1808  break;
1809  default: pips_internal_error("unexpected syntax tag");
1810  }
1811 
1813  "not typed '%s' used as a function.",
1814  what, entity_local_name(call_function(c)));
1815  context->number_of_error++;
1816  okay = false;
1817  }
1818  else if (!((integer_ok && basic_int_p(b) && basic_int(b)==4) ||
1819  (longinteger_ok && basic_int_p(b) && basic_int(b)==6) ||
1820  (longlonginteger_ok && basic_int_p(b) && basic_int(b)==8) ||
1821  (real_ok && basic_float_p(b) && basic_float(b)==4) ||
1822  (double_ok && basic_float_p(b) && basic_float(b)==8) ||
1823  (longdouble_ok && basic_float_p(b) && basic_float(b)==16) ||
1824  (complex_ok && basic_complex_p(b) && basic_complex(b)==8) ||
1825  (dcomplex_ok && basic_complex_p(b) && basic_complex(b)==16) ||
1826  (longdcomplex_ok && basic_complex_p(b) && basic_complex(b)==32) ||
1827  (logical_ok && basic_logical_p(b)) ||
1828  (character_ok && basic_string_p(b))))
1829  {
1830  /* The message should be language dependent, C or Fortran */
1833  "#%d argument of '%s' must be "
1834  "%s%s%s%s%s%s%s%s%s%s%s but not %s",
1835  argnumber,
1837  integer_ok? "INT, ": "",
1838  // The next two types are not used
1839  // for Fortran
1840  longinteger_ok? "": "",
1841  longlonginteger_ok? "": "",
1842  real_ok? "REAL, ": "",
1843  double_ok? "DOUBLE, ": "",
1844  // FI: Used to be QUAD. Exists or not?
1845  //longdouble_ok? "DOUBLE*16, ": "",
1846  longdouble_ok? "": "",
1847  complex_ok? "COMPLEX, ": "",
1848  dcomplex_ok? "DCOMPLEX, ": "",
1849  // FI: what should it be in Fortran?
1850  longdcomplex_ok? "": "",
1851  logical_ok? "LOGICAL, ": "",
1852  character_ok? "CHARACTER, ": "",
1853  basic_to_string(b));
1854  } else { /* Assume C */
1855  /* FI: assumes no pointers ever; still pretty much
1856  Fortran stuff */
1858  "#%d argument of '%s' must be "
1859  "%s%s%s%s%s%s%s%s%s%s%s but not %s",
1860  argnumber,
1862  integer_ok? "int, ": "",
1863  longinteger_ok? "long int, ": "",
1864  longlonginteger_ok? "long long int, ": "",
1865  real_ok? "float, ": "",
1866  double_ok? "double, ": "",
1867  longdouble_ok? "long double, ": "",
1868  complex_ok? "complex, ": "",
1869  dcomplex_ok? "double complex, ": "",
1870  longdcomplex_ok? "long double complex, ": "",
1871  logical_ok? "bool, ": "",
1872  /* FI: nothing about strings? */
1873  character_ok? "char, ": "",
1874  basic_to_string(b));
1875  }
1876  context->number_of_error++;
1877  okay = false;
1878  }
1879 
1880  /* if TC_DCOMPLEX, maybe they should not be incompatible? */
1881  arg_cmplx = arg_cmplx ||
1882  (complex_ok && basic_complex_p(b) && basic_complex(b)==8);
1883 
1884  arg_double = arg_double ||
1885  (double_ok && basic_float_p(b) && basic_float(b)==8);
1886  }
1887 
1888  if (arg_cmplx && arg_double)
1889  {
1891  "mixed complex and double arguments of '%s' forbidden",
1893  context->number_of_error++;
1894  okay = false;
1895  }
1896 
1897  return okay;
1898 }
1899 
1900 static bool
1902 {
1904  (c, context, true, true, true, true, true, true, true, TC_DCOMPLEX, TC_LONGDCOMPLEX, false, true);
1905 }
1906 
1907 static bool
1909 {
1911  (c, context, true, true, true, true, true, true, true, TC_DCOMPLEX, TC_LONGDCOMPLEX, false, false);
1912 }
1913 static bool
1915 {
1917  (c, context, false, false, false, false, false, false, false, false, false, false, true);
1918 }
1919 static bool
1921 {
1923  (c, context, false, false, false, false, false, false, false, false, false, true, false);
1924 }
1925 static bool
1927 {
1929  (c, context, false, false, false, true, true, true, false, false, false, false, false);
1930 }
1931 
1932 static bool
1934 {
1936  (c, context, true, true, true, true, false, false, false, false, false, false, false);
1937 }
1938 static bool
1940 {
1942  (c, context, true, true, true, true, true, true, false, false, false, false, false);
1943 }
1944 /**************************************************************************
1945  * Verify if all the arguments basic of function C are REAL, DOUBLE
1946  * and COMPLEX
1947  * According to (ANSI X3.9-1978 FORTRAN 77, Table 2 & 3, Page 6-5 & 6-6),
1948  * it is prohibited an arithetic operator operaters on
1949  * a pair of DOUBLE and COMPLEX, so that I return false in that case.
1950  *
1951  * PDSon: If there is no argument, I return TRUE
1952  */
1953 static bool
1955 {
1957  (c, context, false, false, false, true, true, true, true, TC_DCOMPLEX, TC_LONGDCOMPLEX, false, false);
1958 }
1959 
1960 /**************************************************************************
1961  * Verification if all the arguments are compatible
1962  * PDSon: If #arguments <=1, I return true
1963  */
1964 bool
1966 {
1967  basic b1, b2;
1968  b1 = basic_undefined;
1969 
1970  MAP(EXPRESSION, e,
1971  {
1972  /* First item */
1973  if(basic_undefined_p(b1))
1974  {
1975  b1 = GET_TYPE(types, e);
1976  }
1977  /* Next item */
1978  else
1979  {
1980  b2 = GET_TYPE(types, e);
1981  if(!basic_compatible_p(b1, b2))
1982  {
1983  return false;
1984  }
1985  }
1986  }
1987  , call_arguments(c));
1988 
1989  return true;
1990 }
1991 
1992 /**************************************************************************
1993  * Typing all the arguments of c to basic b if their basic <> b
1994  */
1995 static void
1997 {
1998  basic b1;
1999  list args = call_arguments(c);
2000 
2001  while (args != NIL)
2002  {
2003  b1 = GET_TYPE(context->types, EXPRESSION(CAR(args)));
2004  if (!basic_equal_p(b, b1))
2005  {
2006  EXPRESSION_(CAR(args)) =
2007  insert_cast(b, b1, EXPRESSION(CAR(args)), context);
2008  /* Update hash table */
2009  PUT_TYPE(context->types, EXPRESSION(CAR(args)), copy_basic(b));
2010  }
2011  args = CDR(args);
2012  }
2013 }
2014 
2015 /**************************************************************************
2016  * TYPING THE INTRINSIC FUNCTIONS
2017  * Typing arithmetic operator (+, -, --, *, /), except **
2018  */
2019 static basic
2021 {
2022  basic b;
2023 
2024  if(!arguments_are_IRDC(c, context))
2025  {
2026  /* Just for return a result */
2027  return make_basic_float(4);
2028  }
2029  /* Find the longest type amongs all arguments */
2030  b = basic_union_arguments(c, context->types);
2031 
2032  /* Typing all arguments to b if necessary */
2033  typing_arguments(c, context, b);
2034 
2035  return b;
2036 }
2037 /**************************************************************************
2038  * Typing power operator (**)
2039  */
2040 static basic
2042 {
2043  basic b, b1, b2;
2044  list /* of expression */ args = call_arguments(c);
2045  b = basic_undefined;
2046 
2047  if(!arguments_are_IRDC(c, context))
2048  {
2049  /* Just for return a result */
2050  return make_basic_float(4);
2051  }
2052 
2053  b1 = GET_TYPE(context->types, EXPRESSION(CAR(args)));
2054  b2 = GET_TYPE(context->types, EXPRESSION(CAR(CDR(args))));
2055 
2056  if (is_inferior_basic(b1, b2))
2057  {
2058  b = b2;
2059  }
2060  else
2061  {
2062  b = b1;
2063  }
2064 
2065  if (!basic_equal_p(b, b1))
2066  {
2067  EXPRESSION_(CAR(args)) =
2068  insert_cast(b, b1, EXPRESSION(CAR(args)), context);
2069  }
2070  /* Fortran prefers: (ANSI X3.9-1978, FORTRAN 77, PAGE 6-6, TABLE 3)
2071  * "var_double = var_double ** var_int" instead of
2072  * "var_double = var_double ** DBLE(var_int)"
2073  */
2074  if (!basic_equal_p(b, b2) && !basic_int_p(b2))
2075  {
2076  EXPRESSION_(CAR(CDR(args))) =
2077  insert_cast(b, b2, EXPRESSION(CAR(CDR(args))), context);
2078  }
2079  return copy_basic(b);
2080 }
2081 /**************************************************************************
2082  * Typing relational operator (LT, LE, EQ, GT, GE)
2083  */
2084 static basic
2086 {
2087  basic b;
2088 
2089  if(!arguments_are_IRDCS(c, context))
2090  {
2091  /* Just for return a result */
2092  return make_basic_logical(4);
2093  }
2094  /* Find the longest type amongs all arguments */
2095  b = basic_union_arguments(c, context->types);
2096 
2097  /* Typing all arguments to b if necessary */
2098  typing_arguments(c, context, b);
2099 
2100  free_basic(b);
2101  return make_basic_logical(4);
2102 }
2103 /**************************************************************************
2104  * Typing logical operator (NOT, AND, OR, EQV, NEQV)
2105  */
2106 static basic
2108 {
2110  {
2111  /* Just for return a result */
2112  return make_basic_logical(4);
2113  }
2114  return make_basic_logical(4);
2115 }
2116 /**************************************************************************
2117  * Typing concatenate operator (//)
2118  */
2119 static basic
2121 {
2123  {
2124  /* Just for return a result */
2126  }
2128 }
2129 
2130 /**************************************************************************
2131  * Typing function C whose argument type is from_type and
2132  * whose return type is to_type
2133  */
2134 static basic
2136  basic from_type, basic to_type)
2137 {
2138  bool check_arg = false;
2139 
2140  /* INT */
2141  if(basic_int_p(from_type) && basic_int(from_type) == 4)
2142  {
2143  check_arg = arguments_are_integer(c, context->types);
2144  }
2145  /* LONG INT : added by MB */
2146  else if(basic_int_p(from_type) && basic_int(from_type) == 6)
2147  {
2148  check_arg = arguments_are_longinteger(c, context->types);
2149  }
2150  /* LONG LONG INT */
2151  else if(basic_int_p(from_type) && basic_int(from_type) == 8)
2152  {
2153  check_arg = arguments_are_longlonginteger(c, context->types);
2154  }
2155  /* REAL */
2156  else if(basic_float_p(from_type) && basic_float(from_type) == 4)
2157  {
2158  check_arg = arguments_are_real(c, context->types);
2159  }
2160  /* DOUBLE */
2161  else if(basic_float_p(from_type) && basic_float(from_type) == 8)
2162  {
2163  check_arg = arguments_are_double(c, context->types);
2164  }
2165  /* LONG DOUBLE : added by MB */
2166  else if(basic_float_p(from_type) && basic_float(from_type) == 16)
2167  {
2168  check_arg = arguments_are_longdouble(c, context->types);
2169  }
2170  /* COMPLEX */
2171  else if(basic_complex_p(from_type) && basic_complex(from_type) == 8)
2172  {
2173  check_arg = arguments_are_complex(c, context->types);
2174  }
2175  /* DOUBLE COMPLEX */
2176  else if(basic_complex_p(from_type) && basic_complex(from_type) == 16)
2177  {
2178  if (TC_DCOMPLEX)
2179  check_arg = arguments_are_dcomplex(c, context->types);
2180  }
2181  /* LONG DOUBLE COMPLEX : added by MB*/
2182  else if(basic_complex_p(from_type) && basic_complex(from_type) == 32)
2183  {
2184  if (TC_LONGDCOMPLEX)
2185  check_arg = arguments_are_longdcomplex(c, context->types);
2186  }
2187  /* CHAR */
2188  else if(basic_string_p(from_type))
2189  {
2190  check_arg = arguments_are_character(c, context);
2191  }
2192  /* LOGICAL */
2193  else if(basic_logical_p(from_type))
2194  {
2195  check_arg = arguments_are_logical(c, context);
2196  }
2197  /* UNEXPECTED */
2198  else
2199  {
2200  pips_internal_error("Unexpected basic: %s ",
2201  basic_to_string(from_type));
2202  }
2203 
2204  /* ERROR: Invalide of argument type */
2205  if(check_arg == false)
2206  {
2208  "Invalid argument(s) to '%s'!",
2210 
2211  /* Count the number of errors */
2212  context->number_of_error++;
2213  }
2214 
2215  return copy_basic(to_type);
2216 }
2217 
2218 static basic
2220 {
2221  basic result, type_INT = make_basic_int(4);
2223  type_INT, type_INT);
2224  free_basic(type_INT);
2225  return result;
2226 }
2227 static basic
2229 {
2230  basic result, type_LINT = make_basic_int(6);
2232  type_LINT, type_LINT);
2233  free_basic(type_LINT);
2234  return result;
2235 }
2236 static basic
2238 {
2239  basic result, type_LLINT = make_basic_int(8);
2241  type_LLINT, type_LLINT);
2242  free_basic(type_LLINT);
2243  return result;
2244 }
2245 static basic
2247 {
2248  basic result, type_REAL = make_basic_float(4);
2250  type_REAL, type_REAL);
2251  free_basic(type_REAL);
2252  return result;
2253 }
2254 static basic
2256 {
2257  basic result, type_DBLE = make_basic_float(8);
2259  type_DBLE, type_DBLE);
2260  free_basic(type_DBLE);
2261  return result;
2262 }
2263 static basic
2265 {
2266  basic result, type_LDBLE = make_basic_float(16);
2268  type_LDBLE, type_LDBLE);
2269  free_basic(type_LDBLE);
2270  return result;
2271 }
2272 static basic
2274 {
2275  basic result, type_CMPLX = make_basic_complex(8);
2277  type_CMPLX, type_CMPLX);
2278  free_basic(type_CMPLX);
2279  return result;
2280 }
2281 static basic
2283 {
2284  basic result, type_DCMPLX = make_basic_complex(16);
2286  type_DCMPLX, type_DCMPLX);
2287  free_basic(type_DCMPLX);
2288  return result;
2289 }
2290 static basic
2291 typing_function_longdcomplex_to_longdcomplex(call c, type_context_p context) /*MB: added for long double complex type*/
2292 {
2293  basic result, type_LDCMPLX = make_basic_complex(32);
2295  type_LDCMPLX, type_LDCMPLX);
2296  free_basic(type_LDCMPLX);
2297  return result;
2298 }
2299 static basic
2301 {
2302  basic result, type_LDBLE = make_basic_float(16);
2303  basic type_LDCMPLX = make_basic_complex(32);
2305  type_LDCMPLX, type_LDBLE);
2306  free_basic(type_LDBLE);
2307  free_basic(type_LDCMPLX);
2308  return result;
2309 }
2310 static basic
2312 {
2313  basic result, type_INT = make_basic_int(4);
2316  type_INT);
2317  free_basic(type_INT);
2318  free_basic(type_CHAR);
2319  return result;
2320 }
2321 static basic
2323 {
2324  basic result, type_INT = make_basic_int(4);
2327  type_INT,
2328  type_CHAR);
2329  free_basic(type_INT);
2330  free_basic(type_CHAR);
2331  return result;
2332 }
2333 static basic
2335 {
2336  basic result, type_INT = make_basic_int(4);
2337  basic type_REAL = make_basic_float(4);
2339  type_REAL,
2340  type_INT);
2341  free_basic(type_INT);
2342  free_basic(type_REAL);
2343  return result;
2344 }
2345 static basic
2347 {
2348  basic result, type_LINT = make_basic_int(6);
2349  basic type_REAL = make_basic_float(4);
2351  type_REAL,
2352  type_LINT);
2353  free_basic(type_LINT);
2354  free_basic(type_REAL);
2355  return result;
2356 }
2357 static basic
2359 {
2360  basic result, type_LLINT = make_basic_int(8);
2361  basic type_REAL = make_basic_float(4);
2363  type_REAL,
2364  type_LLINT);
2365  free_basic(type_LLINT);
2366  free_basic(type_REAL);
2367  return result;
2368 }
2369 static basic
2371 {
2372  basic result, type_INT = make_basic_int(4);
2373  basic type_REAL = make_basic_float(4);
2375  type_INT,
2376  type_REAL);
2377  free_basic(type_INT);
2378  free_basic(type_REAL);
2379  return result;
2380 }
2381 
2382 /* function added to handle one of the bit manipulation functions :
2383  BTEST. Amira Mensi */
2384 static basic
2386 {
2387  basic result, type_INT = make_basic_int(4);
2388  basic type_LOGICAL = make_basic_float(4);
2390  type_INT,
2391  type_LOGICAL);
2392  free_basic(type_INT);
2393  free_basic(type_LOGICAL);
2394  return result;
2395 }
2396 
2397 static basic
2399 {
2400  basic result, type_INT = make_basic_int(4);
2401  basic type_DBLE = make_basic_float(8);
2403  type_DBLE,
2404  type_INT);
2405  free_basic(type_INT);
2406  free_basic(type_DBLE);
2407  return result;
2408 }
2409 static basic
2411 {
2412  basic result, type_LINT = make_basic_int(6);
2413  basic type_DBLE = make_basic_float(8);
2415  type_DBLE, type_LINT);
2416  free_basic(type_LINT);
2417  free_basic(type_DBLE);
2418  return result;
2419 }
2420 
2421 static basic
2423 {
2424  basic result, type_LLINT = make_basic_int(8);
2425  basic type_DBLE = make_basic_float(8);
2427  type_DBLE, type_LLINT);
2428  free_basic(type_LLINT);
2429  free_basic(type_DBLE);
2430  return result;
2431 }
2432 static basic
2434 {
2435  basic result, type_INT = make_basic_int(4);
2436  basic type_LDBLE = make_basic_float(16);
2438  type_LDBLE,
2439  type_INT);
2440  free_basic(type_INT);
2441  free_basic(type_LDBLE);
2442  return result;
2443 }
2444 
2445 static basic
2447 {
2448  basic result, type_LINT = make_basic_int(6);
2449  basic type_LDBLE = make_basic_float(16);
2451  type_LDBLE,
2452  type_LINT);
2453  free_basic(type_LINT);
2454  free_basic(type_LDBLE);
2455  return result;
2456 }
2457 
2458 static basic
2460 {
2461  basic result, type_LLINT = make_basic_int(8);
2462  basic type_LDBLE = make_basic_float(16);
2464  type_LDBLE,
2465  type_LLINT);
2466  free_basic(type_LLINT);
2467  free_basic(type_LDBLE);
2468  return result;
2469 }
2470 static basic
2472 {
2473  basic result, type_REAL = make_basic_float(4);
2474  basic type_DBLE = make_basic_float(8);
2476  type_REAL,
2477  type_DBLE);
2478  free_basic(type_REAL);
2479  free_basic(type_DBLE);
2480  return result;
2481 }
2482 static basic
2484 {
2485  basic result, type_REAL = make_basic_float(4);
2486  basic type_CMPLX = make_basic_complex(8);
2488  type_CMPLX,
2489  type_REAL);
2490  free_basic(type_REAL);
2491  free_basic(type_CMPLX);
2492  return result;
2493 }
2494 static basic
2496 {
2497  basic result, type_DBLE = make_basic_float(8);
2498  basic type_DCMPLX = make_basic_complex(16);
2500  type_DCMPLX,
2501  type_DBLE);
2502  free_basic(type_DBLE);
2503  free_basic(type_DCMPLX);
2504  return result;
2505 }
2506 static basic
2508 {
2509  basic result, type_LOGICAL = make_basic_logical(4);
2512  type_CHAR,
2513  type_LOGICAL);
2514  free_basic(type_LOGICAL);
2515  free_basic(type_CHAR);
2516  return result;
2517 }
2518 
2519 /**************************************************************************
2520  * Arguments are REAL (or DOUBLE); and the return is the same with argument
2521  */
2522 static basic
2524 {
2525  basic b;
2526 
2527  if(!arguments_are_RD(c, context))
2528  {
2529  return make_basic_float(4); /* Just for return a result */
2530  }
2531  /* Find the longest type amongs all arguments */
2532  b = basic_union_arguments(c, context->types);
2533 
2534  /* Typing all arguments to b if necessary */
2535  typing_arguments(c, context, b);
2536 
2537  return b;
2538 }
2539 static basic
2541 {
2542  basic b;
2543 
2544  if(!arguments_are_RD(c, context))
2545  {
2546  return make_basic_float(4); /* Just for return a result */
2547  }
2548  /* Find the longest type amongs all arguments */
2549  b = basic_union_arguments(c, context->types);
2550 
2551  /* Typing all arguments to b if necessary */
2552  typing_arguments(c, context, b);
2553 
2554  free_basic(b);
2555  return make_basic_int(4);
2556 }
2557 static basic
2560 {
2561  basic b;
2562 
2563  if(!arguments_are_RDC(c, context))
2564  {
2565  return make_basic_float(4); /* Just for return a result */
2566  }
2567  /* Find the longest type amongs all arguments */
2568  b = basic_union_arguments(c, context->types);
2569 
2570  /* Typing all arguments to b if necessary */
2571  typing_arguments(c, context, b);
2572 
2573  return b;
2574 }
2575 static basic
2578 {
2579  basic b;
2580 
2581  if(!arguments_are_IRD(c, context))
2582  {
2583  return make_basic_float(4); /* Just for return a result */
2584  }
2585  /* Find the longest type amongs all arguments */
2586  b = basic_union_arguments(c, context->types);
2587 
2588  // Typing all arguments to b if necessary
2589  typing_arguments(c, context, b);
2590 
2591  return b;
2592 }
2593 /**************************************************************************
2594  * The arguments are INT, REAL, DOUBLE or COMPLEX. The return is the same
2595  * with the argument except case argument are COMPLEX, return is REAL
2596  *
2597  * Note: Only for Intrinsic ABS(): ABS(CMPLX(x)) --> REAL
2598  */
2599 static basic
2602 {
2603  basic b;
2604 
2605  if(!arguments_are_IRDC(c, context))
2606  {
2607  return make_basic_float(4); /* Just for return result */
2608  }
2609  /* Find the longest type amongs all arguments */
2610  b = basic_union_arguments(c, context->types);
2611 
2612  /* Typing all arguments to b if necessary */
2613  typing_arguments(c, context, b);
2614 
2615  if (basic_complex_p(b) )
2616  {
2617  if (basic_complex(b)==8)
2618  {
2619  free_basic(b);
2620  b = make_basic_float(4); /* CMPLX --> REAL */
2621  } else if (basic_complex(b)==16 && TC_DCOMPLEX) {
2622  free_basic(b);
2623  b = make_basic_float(8); /* DCMPLX -> DOUBLE */
2624  } /* else? */
2625  }
2626  return b;
2627 }
2628 
2629 /**************************************************************************
2630  * Intrinsic conversion to a numeric
2631  *
2632  * Note: argument must be numeric
2633  */
2634 static basic
2636  basic to_type)
2637 {
2638  if(!arguments_are_IRDC(c, context))
2639  {
2640  return copy_basic(to_type);
2641  }
2642  return copy_basic(to_type);
2643 }
2644 static basic
2646 {
2647  basic result, b = make_basic_int(4);
2649  free_basic(b);
2650  return result;
2651 }
2652 static basic
2654 {
2655  basic result, b = make_basic_float(4);
2657  free_basic(b);
2658  return result;
2659 }
2660 static basic
2662 {
2663  basic result, b = make_basic_float(8);
2665  free_basic(b);
2666  return result;
2667 }
2668 static basic
2670 {
2671  basic b;
2672  expression arg;
2673  if(!arguments_are_IRDC(c, context))
2674  {
2675  return make_basic_float(4); /* Just for return result */
2676  }
2677 
2678  arg = EXPRESSION(CAR(call_arguments(c)));
2679  if (CDR(call_arguments(c)) == NIL &&
2680  basic_complex_p(GET_TYPE(context->types, arg)))
2681  {
2682  syntax ss = expression_syntax(arg);
2683  if (syntax_call_p(ss))
2684  {
2686  context->number_of_conversion++;
2687  }
2688  else /* Argument is a varibale */
2689  {
2690  return make_basic_complex(8);
2691  }
2692  /* Free memory occupied by old argument list*/
2693  }
2694 
2695  /* Typing all arguments to REAL if necessary */
2696  b = make_basic_float(4);
2697  typing_arguments(c, context, b);
2698  free_basic(b);
2699 
2700  return make_basic_complex(8);
2701 }
2702 static basic
2704 {
2705  basic b;
2706  expression arg;
2707  if(!arguments_are_IRDC(c, context))
2708  {
2709  return make_basic_float(4); /* Just for return result */
2710  }
2711 
2712  arg = EXPRESSION(CAR(call_arguments(c)));
2713  if (CDR(call_arguments(c)) == NIL &&
2714  basic_complex_p(GET_TYPE(context->types, arg)))
2715  {
2716  syntax ss = expression_syntax(arg);
2717  if (syntax_call_p(ss))
2718  {
2720  context->number_of_conversion++;
2721  }
2722  else /* Argument is a varibale */
2723  {
2724  return make_basic_complex(16);
2725  }
2726  /* Free memory occupied by old argument list */
2727  }
2728 
2729  /* Typing all arguments to DBLE if necessary */
2730  b = make_basic_float(8);
2731  typing_arguments(c, context, b);
2732  free_basic(b);
2733 
2734  return make_basic_complex(16);
2735 }
2736 /* CMPLX_ */
2737 static basic
2739 {
2740  basic b;
2741  if(!arguments_are_IR(c, context))
2742  {
2743  return make_basic_float(4); /* Just for return result */
2744  }
2745 
2746  /* Typing all arguments to REAL if necessary */
2747  b = make_basic_float(4);
2748  typing_arguments(c, context, b);
2749  free_basic(b);
2750 
2751  return make_basic_complex(8);
2752 }
2753 /* DCMPLX_ */
2754 static basic
2756 {
2757  basic b;
2758  if(!arguments_are_IRD(c, context))
2759  {
2760  return make_basic_float(4); /* Just for return result */
2761  }
2762 
2763  /* Typing all arguments to DOUBLE if necessary */
2764  b = make_basic_float(8);
2765  typing_arguments(c, context, b);
2766  free_basic(b);
2767 
2768  return make_basic_complex(16);
2769 }
2770 
2771 static basic
2774 {
2775  return make_basic_overloaded();
2776 }
2777 
2778 static basic
2781 {
2782  return make_basic_int(4);
2783 }
2784 
2785 static basic
2787 {
2788  list args = call_arguments(c);
2789  basic b1, b2;
2790 
2791  if(!arguments_are_compatible(c, context->types))
2792  {
2794  "Arguments of assignment '%s' are not compatible",
2796  /* Count the number of errors */
2797  context->number_of_error++;
2798  }
2799  else
2800  {
2801  b1 = GET_TYPE(context->types, EXPRESSION(CAR(args)));
2802  b2 = GET_TYPE(context->types, EXPRESSION(CAR(CDR(args))));
2803  if (!basic_equal_p(b1, b2))
2804  {
2805  EXPRESSION_(CAR(CDR(args))) =
2806  insert_cast(b1, b2, EXPRESSION(CAR(CDR(args))), context);
2807  }
2808  }
2809 
2810  /* Here, we aren't interested in the type of return */
2811  return basic_undefined;
2812 }
2813 
2814 static basic
2816 {
2817  int count = 0;
2818 
2819  MAP(EXPRESSION, e,
2820  {
2821  count++;
2822  switch (count)
2823  {
2824  case 1:
2825  if( !basic_string_p(GET_TYPE(context->types, e)) ||
2827  {
2829  "Argument #1 must be a reference to string");
2830  /* Count the number of errors */
2831  context->number_of_error++;
2832  }
2833  break;
2834  case 2:
2835  case 3:
2836  if( !basic_int_p(GET_TYPE(context->types, e)))
2837  {
2839  "Argument #%d must be an integer expression",
2840  count);
2841  /* Count the number of errors */
2842  context->number_of_error++;
2843  }
2844  break;
2845  default: /* count > 3 */
2847  "Too many of arguments for sub-string function");
2848  /* Count the number of errors */
2849  context->number_of_error++;
2851  }
2852  },
2853  call_arguments(c));
2854  if (count < 3)
2855  {
2857  "Lack of %d argument(s) for sub-string function",
2858  3-count);
2859  /* Count the number of errors */
2860  context->number_of_error++;
2861  }
2862 
2864 }
2865 
2866 static basic
2868 {
2869  int count = 0;
2870  MAP(EXPRESSION, e,
2871  {
2872  count++;
2873  switch (count)
2874  {
2875  case 1:
2876  if( !basic_string_p(GET_TYPE(context->types, e)) ||
2878  {
2880  "Argument #1 must be a reference to string");
2881  /* Count the number of errors */
2882  context->number_of_error++;
2883  }
2884  break;
2885  case 2:
2886  case 3:
2887  if( !basic_int_p(GET_TYPE(context->types, e)))
2888  {
2890  "Argument #%d must be an integer expression",
2891  count);
2892  /* Count the number of errors */
2893  context->number_of_error++;
2894  }
2895  break;
2896  case 4:
2897  if( !basic_string_p(GET_TYPE(context->types, e)))
2898  {
2900  "Argument #4 must be a string expression");
2901  /* Count the number of errors */
2902  context->number_of_error++;
2903  }
2904  break;
2905  default: /* count > 4 */
2907  "Too many of arguments for assign sub-string function");
2908  /* Count the number of errors */
2909  context->number_of_error++;
2910  return basic_undefined;
2911  }
2912  },
2913  call_arguments(c));
2914  if (count < 4)
2915  {
2917  "Lack of %d argument(s) for assign sub-string function",
2918  4-count);
2919  /* Count the number of errors */
2920  context->number_of_error++;
2921  }
2922  return basic_undefined;
2923 }
2924 
2925 static basic
2927 {
2928  int count = 0;
2929 
2930  MAP(EXPRESSION, e,
2931  {
2932  count++;
2933  switch (count)
2934  {
2935  case 1:
2936  if( !basic_int_p(GET_TYPE(context->types, e)) )
2937  {
2938  add_one_line_of_comment((statement) stack_head(context->stats),
2939  "Argument #1 must be an integer expression");
2940  /* Count the number of errors */
2941  context->number_of_error++;
2942  }
2943  break;
2944  case 2:
2945  case 3:
2946  case 4:
2947  /* PDSon: Nobody knows the type of 3 last arguments, I do nothing here */
2948  break;
2949  default: /* count > 4 */
2951  "Too many of arguments for function '%s'",
2953  /* Count the number of errors */
2954  context->number_of_error++;
2955  return basic_undefined;
2956  }
2957  },
2958  call_arguments(c));
2959 
2960  if (count < 4)
2961  {
2963  "Lack of %d argument(s) for function '%s'",
2965  /* Count the number of errors */
2966  context->number_of_error++;
2967  }
2968  return basic_undefined;
2969 }
2970 
2971 static basic no_typing(call __attribute__ ((unused)) c,
2973 {
2974  basic bt = basic_undefined;
2975  pips_internal_error("This should not be type-checked because it is not Fortran function");
2976  return bt; /* To please the compiler */
2977 }
2978 
2979 static basic
2981 {
2982  basic b_int = NULL;
2983  int count = 0;
2984 
2985  MAP(EXPRESSION, e,
2986  {
2987  count++;
2988  switch (count)
2989  {
2990  case 1:
2991  b_int = GET_TYPE(context->types, e);
2992  if( !basic_int_p(GET_TYPE(context->types, e)) ||
2994  {
2996  "Argument #1 must be a reference to integer");
2997  /* Count the number of errors */
2998  context->number_of_error++;
2999  }
3000  break;
3001 
3002  case 2: /* range */
3004  {
3006  "Argument #2 must be a range of integer");
3007  /* Count the number of errors */
3008  context->number_of_error++;
3009  return basic_undefined;
3010  }
3011  else
3012  {
3014  if (!check_loop_range(r, context->types))
3015  {
3017  "Range must be Integer, Real or Double!");
3018  context->number_of_error++;
3019  }
3020  else
3021  {
3022  type_loop_range(b_int, r, context);
3023  }
3024  }
3025  return basic_undefined;
3026  }
3027  },
3028  call_arguments(c));
3029 
3030  if (count < 2)
3031  {
3033  "Lack of %d argument(s) for function '%s'",
3035  /* Count the number of errors */
3036  context->number_of_error++;
3037  }
3038  return basic_undefined;
3039 }
3040 
3041 /******************* VERIFICATION SYNTAX FOR STATEMENTS ********************/
3042 /* Verify if an expression is a constant:
3043  * YES : return true; otherwise, return FALSE
3044  */
3045 static bool
3047 {
3049  if (!syntax_call_p(s))
3050  {
3051  return false;
3052  }
3054 }
3055 
3056 /* Verify if an expression is a constant of basic b:
3057  * YES : return true; otherwise, return FALSE
3058  */
3059 static bool
3061 {
3062  type call_type, return_type;
3063  basic bb;
3064  if (!is_constant(exp))
3065  {
3066  return false;
3067  }
3069  return_type = functional_result(type_functional(call_type));
3070  bb = variable_basic(type_variable(return_type));
3071  if (basic_undefined_p(bb) || !basic_equal_p(b, bb))
3072  {
3073  return false;
3074  }
3075  return true;
3076 }
3077 
3078 static basic
3080 {
3081  if (call_arguments(c) != NIL)
3082  {
3084  "Statement '%s' doesn't need any argument",
3086  /* Count the number of errors */
3087  context->number_of_error++;
3088  }
3089 
3090  /* Here, we are not interested in the basic returned */
3091  return basic_undefined;
3092 }
3093 /***************************************************************************
3094  * Statement with at most one argument: integer or character constant,
3095  * like PAUSE, STOP.
3096  * Attention: Integer value must be <= 99999 (at most 5 digits)
3097  * (According to ANSI X3.9-1978 FORTRAN 77; PAGE 11-9)
3098  */
3099 static basic
3102 {
3103  basic b_int, b_char;
3104  expression arg1;
3105  entity en;
3106  int l;
3107  list args = call_arguments(c);
3108  if (args != NIL)
3109  {
3110  b_int = make_basic_int(4);
3111  b_char = make_basic_string(0);
3112  arg1 = EXPRESSION(CAR(args));
3113  if ( !is_constant_of_basic(arg1, b_int) &&
3114  !is_constant_of_basic(arg1, b_char))
3115  {
3117  "Argument #1 of '%s' must be an integer or character constant",
3119  /* Count the number of errors */
3120  context->number_of_error++;
3121  }
3122  else if ( is_constant_of_basic(arg1, b_int) )
3123  {
3125  l = strlen(entity_local_name(en));
3126  if (l > 5)
3127  {
3129  "Argument must be an integer of at most 5 digits (instead of '%d')",
3130  l);
3131  /* Count the number of errors */
3132  context->number_of_error++;
3133  }
3134  }
3135 
3136  if (CDR(args) != NIL)
3137  {
3139  "Statement '%s' needs at most an argument, " \
3140  "neight integer constant nor character constant",
3142  /* Count the number of errors */
3143  context->number_of_error++;
3144  }
3145  free_basic(b_int);
3146  free_basic(b_char);
3147  }
3148  /* Here, we are not interested in the basic returned */
3149  return basic_undefined;
3150 }
3151 
3152 static basic
3155 {
3156  basic b;
3157  list args = call_arguments(c);
3158  if (args != NIL)
3159  {
3160  expression arg1 = EXPRESSION(CAR(args));
3161  b = GET_TYPE(context->types, arg1);
3162 
3163  if ( !basic_int_p(b) )
3164  {
3166  "Argument #1 of '%s' must be an integer expression",
3168  /* Count the number of errors */
3169  context->number_of_error++;
3170  }
3171 
3172  if (CDR(args) != NIL)
3173  {
3175  "Statement '%s' needs at most an integer expression",
3177  /* Count the number of errors */
3178  context->number_of_error++;
3179  }
3180  }
3181 
3182  /* Here, we are not interested in the basic returned */
3183  return basic_undefined;
3184 }
3185 
3186 /************************************************ VERIFICATION OF SPECIFIERS */
3187 
3188 static bool
3190 {
3191  call c;
3192  entity fc;
3194  if (!syntax_call_p(s))
3195  {
3196  return false;
3197  }
3198  c = syntax_call(s);
3199  fc = call_function(c);
3200  return entity_label_p(fc);
3201 }
3202 
3203 static bool
3205 {
3206  if (!is_label_statement(e))
3207  {
3209  "%s specifier must be a label statement", s);
3210 
3211  /* Count the number of errors */
3212  context->number_of_error++;
3213  return false;
3214  }
3215  return true;
3216 }
3217 
3218 static bool
3220 {
3221  basic b = GET_TYPE(context->types, e);
3222 
3223  if (!basic_int_p(b))
3224  {
3226  "%s specifier must be an integer expression", s);
3227 
3228  /* Count the number of errors */
3229  context->number_of_error++;
3230  return false;
3231  }
3232  return true;
3233 }
3234 
3235 static bool
3237 {
3238  basic b = GET_TYPE(context->types, e);
3239  if (!basic_string_p(b))
3240  {
3242  "%s specifier must be a character expression", s);
3243 
3244  /* Count the number of errors */
3245  context->number_of_error++;
3246  return false;
3247  }
3248  return true;
3249 }
3250 
3251 static bool
3254 {
3255  basic b = GET_TYPE(context->types, e);
3256  if (!is_label_statement(e) && !basic_int_p(b) && !basic_string_p(b))
3257  {
3259  "%s specifier must be a label, an integer or character expression", s);
3260 
3261  /* Count the number of errors */
3262  context->number_of_error++;
3263  return false;
3264  }
3265 
3266  return true;
3267 }
3268 
3269 static bool
3272 {
3273  if (!basic_equal_p(GET_TYPE(context->types, e), b) ||
3275  {
3277  "%s specifier must be a variable or an array element of %s", s,
3278  basic_string_p(b)? "STRING":basic_to_string(b));
3279 
3280  /* Count the number of errors */
3281  context->number_of_error++;
3282  return false;
3283  }
3284  return true;
3285 
3286 }
3287 /* This function verifies the unit specifier; that is integer positive
3288  * expression or character expression
3289  * (According to ANSI X3.9-1978 FORTRAN 77; PAGE 12-7)
3290  */
3291 static bool
3293 {
3294  basic b;
3295  b = GET_TYPE(context->types, exp);
3296  if (!basic_int_p(b) && !basic_string_p(b))
3297  {
3299  "UNIT specifier must be an integer or character expression");
3300 
3301  /* Count the number of errors */
3302  context->number_of_error++;
3303  return false;
3304  }
3305 
3306  return true;
3307 }
3308 
3309 static bool
3311 {
3312  return is_label_integer_string_specifier("FORMAT", exp, context);
3313 }
3314 
3315 static bool
3317 {
3318  return is_label_integer_string_specifier("RECORD", exp, context);
3319 }
3320 
3321 /* Integer variable or integer array element which is maybe modified
3322  */
3323 static bool
3325 {
3326  basic b = make_basic_int(4);
3327  bool r = is_varibale_array_element_specifier("IOSTAT", exp, b, context);
3328  free_basic(b);
3329  return r;
3330 }
3331 
3332 
3333 /* Error specifier is a label statement
3334  */
3335 static bool
3337 {
3338  return is_label_specifier("ERR", exp, context);
3339 }
3340 
3341 static bool
3343 {
3344  return is_label_specifier("END", exp, context);
3345 }
3346 
3347 static bool
3349 {
3350  return is_string_specifier("FILE", exp, context);
3351 }
3352 
3353 static bool
3355 {
3356  return is_string_specifier("STATUS", exp, context);
3357 }
3358 
3359 static bool
3361 {
3362  return is_string_specifier("ACCESS", exp, context);
3363 }
3364 
3365 static bool
3367 {
3368  return is_string_specifier("FORM", exp, context);
3369 }
3370 
3371 static bool
3373 {
3374  return is_integer_specifier("RECL", exp, context);
3375 }
3376 
3377 static bool
3379 {
3380  return is_string_specifier("BLANK", exp, context);
3381 }
3382 
3383 static bool
3385 {
3386  basic b = make_basic_logical(4);
3387  bool r = is_varibale_array_element_specifier("IOSTAT", exp, b, context);
3388  free_basic(b);
3389  return r;
3390 }
3391 
3392 static bool
3394 {
3395  basic b = make_basic_logical(4);
3396  bool r = is_varibale_array_element_specifier("OPENED", exp, b, context);
3397  free_basic(b);
3398  return r;
3399 }
3400 
3401 static bool
3403 {
3404  basic b = make_basic_int(4);
3405  bool r = is_varibale_array_element_specifier("NUMBER", exp, b, context);
3406  free_basic(b);
3407  return r;
3408 }
3409 
3410 static bool
3412 {
3413  basic b = make_basic_logical(4);
3414  bool r = is_varibale_array_element_specifier("NAMED", exp, b, context);
3415  free_basic(b);
3416  return r;
3417 }
3418 
3419 static bool
3421 {
3422  basic b = make_basic_string(0);
3423  bool r = is_varibale_array_element_specifier("NAME", exp, b, context);
3424  free_basic(b);
3425  return r;
3426 }
3427 
3428 static bool
3430 {
3431  basic b = make_basic_string(0);
3432  bool r = is_varibale_array_element_specifier("SEQUENTIAL", exp, b, context);
3433  free_basic(b);
3434  return r;
3435 }
3436 
3437 static bool
3439 {
3440  basic b = make_basic_string(0);
3441  bool r = is_varibale_array_element_specifier("DIRECT", exp, b, context);
3442  free_basic(b);
3443  return r;
3444 }
3445 
3446 static bool
3448 {
3449  basic b = make_basic_string(0);
3450  bool r = is_varibale_array_element_specifier("FORMATTED", exp, b, context);
3451  free_basic(b);
3452  return r;
3453 }
3454 
3455 static bool
3457 {
3458  basic b = make_basic_string(0);
3459  bool r = is_varibale_array_element_specifier("UNFORMATTED", exp, b, context);
3460  free_basic(b);
3461  return r;
3462 }
3463 
3464 static bool
3466 {
3467  basic b = make_basic_int(4);
3468  bool r = is_varibale_array_element_specifier("NEXTREC", exp, b, context);
3469  free_basic(b);
3470  return r;
3471 }
3472 
3473 static bool
3474 check_spec (string name,
3475  bool allowed,
3476  const char* specifier,
3477  expression contents,
3479  bool (*check_contents)(expression, type_context_p))
3480 {
3481  if (same_string_p(name, specifier))
3482  {
3483  if (allowed)
3484  {
3485  if (check_contents(contents, context))
3486  {
3487  return true;
3488  }
3489  /* else ok */
3490  }
3491  else /* not allowed */
3492  {
3494  "Specifier '%s' is not allowed", name);
3495  context->number_of_error++;
3496  }
3497  return true; /* checked! */
3498  }
3499 
3500  return false;
3501 }
3502 
3503 static bool
3504 check_io_list(list /* of expression */ args,
3505  type_context_p ctxt,
3506  bool a_unit,
3507  bool a_fmt,
3508  bool a_rec,
3509  bool a_iostat,
3510  bool a_err,
3511  bool a_end,
3512  bool a_iolist,
3513  bool a_file,
3514  bool a_status,
3515  bool a_access,
3516  bool a_form,
3517  bool a_blank,
3518  bool a_recl,
3519  bool a_exist,
3520  bool a_opened,
3521  bool a_number,
3522  bool a_named,
3523  bool a_name,
3524  bool a_sequential,
3525  bool a_direct,
3526  bool a_formatted,
3527  bool a_unformatted,
3528  bool a_nextrec)
3529 {
3530  const char* spec;
3531  pips_assert("Even number of arguments", gen_length(args)%2==0);
3532 
3533  for (; args; args = CDR(CDR(args)))
3534  {
3535  expression specifier = EXPRESSION(CAR(args));
3536  expression cont = EXPRESSION(CAR(CDR(args)));
3537 
3538  syntax s = expression_syntax(specifier);
3539  pips_assert("Specifier must be a call with arguments",
3541 
3543 
3544  /* specifier must be UNIT= FMT=... */
3545  if (!check_spec("UNIT=", a_unit, spec, cont, ctxt,
3546  is_unit_specifier) &&
3547  !check_spec("FMT=", a_fmt, spec, cont, ctxt,
3549  !check_spec("IOSTAT=", a_iostat, spec, cont, ctxt,
3551  !check_spec("REC=", a_rec, spec, cont, ctxt,
3553  !check_spec("ERR=", a_err, spec, cont, ctxt,
3554  is_err_specifier) &&
3555  !check_spec("END=", a_end, spec, cont, ctxt,
3556  is_end_specifier) &&
3557  !check_spec("IOLIST=", a_iolist, spec, cont, ctxt,
3558  (bool (*)(expression, type_context_p)) gen_true2) &&
3559  !check_spec("FILE=", a_file, spec, cont, ctxt,
3560  is_file_specifier) &&
3561  !check_spec("STATUS=", a_status, spec, cont, ctxt,
3563  !check_spec("ACCESS=", a_access, spec, cont, ctxt,
3565  !check_spec("FORM=", a_form, spec, cont, ctxt,
3566  is_form_specifier) &&
3567  !check_spec("BLANK=", a_blank, spec, cont, ctxt,
3568  is_blank_specifier) &&
3569  !check_spec("RECL=", a_recl, spec, cont, ctxt,
3570  is_recl_specifier) &&
3571  !check_spec("EXIST=", a_exist, spec, cont, ctxt,
3572  is_exist_specifier) &&
3573  !check_spec("OPENED=", a_opened, spec, cont, ctxt,
3575  !check_spec("NUMBER=", a_number, spec, cont, ctxt,
3577  !check_spec("NAMED=", a_named, spec, cont, ctxt,
3578  is_named_specifier) &&
3579  !check_spec("NAME=", a_name, spec, cont, ctxt,
3580  is_name_specifier) &&
3581  !check_spec("SEQUENTIAL=", a_sequential, spec, cont, ctxt,
3583  !check_spec("DIRECT=", a_direct, spec, cont, ctxt,
3585  !check_spec("FORMATED=", a_formatted, spec, cont, ctxt,
3587  !check_spec("UNFORMATED=", a_unformatted, spec, cont, ctxt,
3589  !check_spec("NEXTREC=", a_nextrec, spec, cont, ctxt,
3591  {
3593  "Unexpected specifier '%s'", spec);
3594  ctxt->number_of_error++;
3595  return false;
3596  }
3597  }
3598 
3599  return true;
3600 }
3601 
3602 static basic
3604 {
3605  list args = call_arguments(c);
3606  check_io_list(args, context,
3607  /* UNIT FMT REC IOSTAT ERR END IOLIST */
3608  true, true, true, true, true, true, true,
3609  /* FILE STATUS ACCESS FORM BLANK RECL EXIST OPENED */
3610  false, false, false, false, false, false, false, false,
3611  /* NUMBER NAMED NAME SEQUENTIAL DIRECT FORMATTED */
3612  false, false, false, false, false, false,
3613  /* UNFORMATTED NEXTREC */
3614  false, false);
3615 
3616  return basic_undefined;
3617 }
3618 
3619 static basic
3621 {
3622  list args = call_arguments(c);
3623  check_io_list(args, context,
3624  /* UNIT FMT REC IOSTAT ERR END IOLIST */
3625  true, false, false, true, true, false, false,
3626  /* FILE STATUS ACCESS FORM BLANK RECL EXIST OPENED */
3627  true, true, true, true, true, true, false, false,
3628  /* NUMBER NAMED NAME SEQUENTIAL DIRECT FORMATTED */
3629  false, false, false, false, false, false,
3630  /* UNFORMATTED NEXTREC */
3631  false, false);
3632  return basic_undefined;
3633 }
3634 
3635 static basic
3637 {
3638  list args = call_arguments(c);
3639 
3640  check_io_list(args, context,
3641  /* UNIT FMT REC IOSTAT ERR END IOLIST */
3642  true, false, false, true, true, false, false,
3643  /* FILE STATUS ACCESS FORM BLANK RECL EXIST OPENED */
3644  false, true, false, false, false, false, false, false,
3645  /* NUMBER NAMED NAME SEQUENTIAL DIRECT FORMATTED */
3646  false, false, false, false, false, false,
3647  /* UNFORMATTED NEXTREC */
3648  false, false);
3649  return basic_undefined;
3650 }
3651 
3652 static basic
3654 {
3655  list args = call_arguments(c);
3656 
3657  check_io_list(args, context,
3658  /* UNIT FMT REC IOSTAT ERR END IOLIST */
3659  true, false, false, true, true, false, false,
3660  /* FILE STATUS ACCESS FORM BLANK RECL EXIST OPENED */
3661  true, false, true, true, true, true, true, true,
3662  /* NUMBER NAMED NAME SEQUENTIAL DIRECT FORMATTED */
3663  true, true, true, true, true, true,
3664  /* UNFORMATTED NEXTREC */
3665  true, true);
3666 
3667  return basic_undefined;
3668 }
3669 
3670 static basic
3672 {
3673  list args = call_arguments(c);
3674  check_io_list(args, context,
3675  /* UNIT FMT REC IOSTAT ERR END IOLIST */
3676  true, false, false, true, true, false, false,
3677  /* FILE STATUS ACCESS FORM BLANK RECL EXIST OPENED */
3678  false, false, false, false, false, false, false, false,
3679  /* NUMBER NAMED NAME SEQUENTIAL DIRECT FORMATTED */
3680  false, false, false, false, false, false,
3681  /* UNFORMATTED NEXTREC */
3682  false, false);
3683  return basic_undefined;
3684 }
3685 
3686 static basic
3688 {
3689  list args = call_arguments(c);
3690  check_io_list(args, context,
3691  /* UNIT FMT REC IOSTAT ERR END IOLIST */
3692  true, false, false, true, true, false, false,
3693  /* FILE STATUS ACCESS FORM BLANK RECL EXIST OPENED */
3694  false, false, false, false, false, false, false, false,
3695  /* NUMBER NAMED NAME SEQUENTIAL DIRECT FORMATTED */
3696  false, false, false, false, false, false,
3697  /* UNFORMATTED NEXTREC */
3698  false, false);
3699  return basic_undefined;
3700 }
3701 
3702 static basic
3704 {
3705  list args = call_arguments(c);
3706  check_io_list(args, context,
3707  /* UNIT FMT REC IOSTAT ERR END IOLIST */
3708  true, false, false, true, true, false, false,
3709  /* FILE STATUS ACCESS FORM BLANK RECL EXIST OPENED */
3710  false, false, false, false, false, false, false, false,
3711  /* NUMBER NAMED NAME SEQUENTIAL DIRECT FORMATTED */
3712  false, false, false, false, false, false,
3713  /* UNFORMATTED NEXTREC */
3714  false, false);
3715  return basic_undefined;
3716 }
3717 
3718 static basic
3720 {
3721  list args = call_arguments(c);
3722  if (args == NIL)
3723  {
3725  "FORMAT statement needs a format specification");
3726  context->number_of_error++;
3727  }
3728  else
3729  {
3730  expression exp = EXPRESSION(CAR(args));
3731  if (!basic_string_p(GET_TYPE(context->types, exp)))
3732  {
3734  "Format specification must be a string");
3735  context->number_of_error++;
3736  }
3737  }
3738  return basic_undefined;
3739 }
3740 
3741 /*********************** SIMPLIFICATION DES EXPRESSIONS **********************/
3742 /* Find the specific name from the specific argument
3743  * ---
3744  * Each intrinsic of name generic have a function for switching to the
3745  * specific name correspondent with the argument
3746  */
3747 static void
3749  string arg_int_name,
3750  string arg_real_name,
3751  string arg_double_name,
3752  string arg_complex_name,
3753  string arg_dcomplex_name)
3754 {
3755  call c;
3756  list args;
3757  basic arg_basic;
3758  string specific_name = NULL;
3759  /* Here, expression_syntax(exp) is always a call */
3761  c = syntax_call(s);
3762  args = call_arguments(c);
3763  arg_basic = GET_TYPE(context->types, EXPRESSION(CAR(args)));
3764 
3765  if (basic_int_p(arg_basic))
3766  {
3767  specific_name = arg_int_name;
3768  }
3769  else if (basic_float_p(arg_basic) && basic_float(arg_basic) == 4)
3770  {
3771  specific_name = arg_real_name;
3772  }
3773  else if (basic_float_p(arg_basic) && basic_float(arg_basic) == 8)
3774  {
3775  specific_name = arg_double_name;
3776  }
3777  else if (basic_complex_p(arg_basic) && basic_complex(arg_basic) == 8)
3778  {
3779  specific_name = arg_complex_name;
3780  }
3781  else if (basic_complex_p(arg_basic) && basic_complex(arg_basic) == 16)
3782  {
3783  if (TC_DCOMPLEX)
3784  specific_name = arg_dcomplex_name;
3785  /* else generic name is kept... */
3786  }
3787 
3788  /* Modify the (function:entity) of the call c if necessary
3789  * NOTE: If specific_name == NULL: Invalid argument or
3790  * argument basic unknown
3791  */
3792  if(specific_name != NULL &&
3793  strcmp(specific_name, entity_local_name(call_function(c))) != 0)
3794  {
3795  call_function(c) = CreateIntrinsic(specific_name);
3796 
3797  /* Count number of simplifications */
3798  context->number_of_simplication++;
3799  }
3800 }
3801 
3802 /* AINT */
3803 static void
3805 {
3807  NULL, "AINT", "DINT", NULL, NULL);
3808 }
3809 /* ANINT */
3810 static void
3812 {
3814  NULL, "ANINT", "DNINT", NULL, NULL);
3815 }
3816 /* NINT */
3817 static void
3819 {
3821  NULL, "NINT", "IDNINT", NULL, NULL);
3822 }
3823 /* ABS */
3824 static void
3826 {
3828  "IABS", "ABS", "DABS", "CABS", "CDABS");
3829 }
3830 /* MOD */
3831 static void
3833 {
3835  "MOD", "AMOD", "DMOD", NULL, NULL);
3836 }
3837 /* SIGN */
3838 static void
3840 {
3842  "ISIGN", "SIGN", "DSIGN", NULL, NULL);
3843 }
3844 /* DIM */
3845 static void
3847 {
3849  "IDIM", "DIM", "DDIM", NULL, NULL);
3850 }
3851 /* MAX */
3852 static void
3854 {
3856  "MAX0", "AMAX1", "DMAX1", NULL, NULL);
3857 }
3858 /* MIN */
3859 static void
3861 {
3863  "MIN0", "AMIN1", "DMIN1", NULL, NULL);
3864 }
3865 /* SQRT */
3866 static void
3868 {
3870  NULL, "SQRT", "DSQRT", "CSQRT", "CDSQRT");
3871 }
3872 /* EXP */
3873 static void
3875 {
3877  NULL, "EXP", "DEXP", "CEXP", "CDEXP");
3878 }
3879 /* LOG */
3880 static void
3882 {
3884  NULL, "ALOG", "DLOG", "CLOG", "CDLOG");
3885 }
3886 /* LOG10 */
3887 static void
3889 {
3891  NULL, "ALOG10", "DLOG10", NULL, NULL);
3892 }
3893 /* SIN */
3894 static void
3896 {
3898  NULL,"SIN","DSIN", "CSIN", "CDSIN");
3899 }
3900 /* COS */
3901 static void
3903 {
3905  NULL, "COS", "DCOS", "CCOS", "CDCOS");
3906 }
3907 /* TAN */
3908 static void
3910 {
3912  NULL, "TAN", "DTAN", NULL, NULL);
3913 }
3914 /* ASIN */
3915 static void
3917 {
3919  NULL, "ASIN", "DASIN", NULL, NULL);
3920 }
3921 /* ACOS */
3922 static void
3924 {
3926  NULL, "ACOS", "DACOS", NULL, NULL);
3927 }
3928 /* ATAN */
3929 static void
3931 {
3933  NULL, "ATAN", "DATAN", NULL, NULL);
3934 }
3935 /* ATAN2 */
3936 static void
3938 {
3940  NULL, "ATAN2", "DATAN2", NULL, NULL);
3941 }
3942 /* SINH */
3943 static void
3945 {
3947  NULL, "SINH", "DSINH", NULL, NULL);
3948 }
3949 /* COSH */
3950 static void
3952 {
3954  NULL, "COSH", "DCOSH", NULL, NULL);
3955 }
3956 /* TANH */
3957 static void
3959 {
3961  NULL, "TANH", "DTANH", NULL, NULL);
3962 }
3963 
3964 /* forward declarations */
3967 
3968 static void
3970 {
3971  if (get_bool_property("TYPE_CHECKER_EXPLICIT_COMPLEX_CONSTANTS"))
3972  {
3973  pips_assert("expression is a call", expression_call_p(exp));
3975  CreateIntrinsic("CMPLX");
3976  }
3978 }
3979 
3980 static void
3982 {
3983  if (get_bool_property("TYPE_CHECKER_EXPLICIT_COMPLEX_CONSTANTS") &&
3984  TC_DCOMPLEX)
3985  {
3986  pips_assert("expression is a call", expression_call_p(exp));
3988  CreateIntrinsic("DCMPLX");
3989  }
3991 }
3992 
3993 /************************* SIMPLIFICATION THE CONVERSION CALL *************
3994  * e.g: INT(INT(R)) -> INT(R)
3995  * INT(2.9) -> 2
3996  * INT(I) -> I
3997  */
3998 static void
4001 {
4002  syntax s_arg;
4003  expression arg, exp_tmp = NULL;
4004  basic b;
4006  arg = EXPRESSION(CAR(call_arguments(c)));
4007  s_arg = expression_syntax(arg);
4008  /* Argument is a variable */
4009  if (syntax_reference_p(s_arg))
4010  {
4011  /* e.g: INT(I) -> I */
4012  if (basic_equal_p(to_basic,
4014  syntax_reference(s_arg)))) &&
4015  CDR(call_arguments(c)) == NIL)
4016  {
4017  exp_tmp = copy_expression(arg);
4018  context->number_of_simplication++;
4019  }
4020  /* e.g: CMPLX(R) -> CMPLX(R, 0.0E0) */
4023  (reference_variable(syntax_reference(s_arg)))) &&
4024  CDR(call_arguments(c)) == NIL)
4025  {
4026  call c_imag;
4027  expression exp_imag;
4028  c_imag = make_call(make_constant_entity("0.0E0",
4029  is_basic_float, 8),
4030  NIL);
4031  exp_imag = make_expression(make_syntax(is_syntax_call, c_imag),
4033  call_arguments(c)
4034  = CONS(EXPRESSION, arg, CONS(EXPRESSION, exp_imag, NIL));
4035  context->number_of_simplication++;
4036  }
4037  /* e.g: DCMPLX(D) -> DCMPLX(D, 0.0D0) */
4040  (reference_variable(syntax_reference(s_arg)))) &&
4041  CDR(call_arguments(c)) == NIL)
4042  {
4043  call c_imag;
4044  expression exp_imag;
4045  c_imag = make_call(make_constant_entity("0.0D0",
4046  is_basic_float, 16),
4047  NIL);
4048  exp_imag = make_expression(make_syntax(is_syntax_call, c_imag),
4050  call_arguments(c)
4051  = CONS(EXPRESSION, arg, CONS(EXPRESSION, exp_imag, NIL));
4052  context->number_of_simplication++;
4053  }
4054  }
4055  /* Argument is a call */
4056  else if(syntax_call_p(s_arg))
4057  {
4058  b = GET_TYPE(context->types, arg);
4059  /* e.g: INT(INT(R)) -> INT(R) */
4060  if (basic_equal_p(b, to_basic))
4061  {
4062  exp_tmp = copy_expression(arg);
4063 
4064  context->number_of_simplication++;
4065  }
4066  /* Cast constant if necessary */
4067  /* Conversion: CMPLX, CMPLX_, DCMPLX, DCMPLX_ */
4068  else if (ENTITY_IMPLIED_CMPLX_P(call_function(c)) ||
4072  {
4073  list args = call_arguments(c);
4074  basic b_arg = GET_TYPE(context->types, arg);
4075  /* Imagine party is empty */
4076  if (CDR(args) == NIL)
4077  {
4078  /* Argument is NOT complex or double complex */
4079  if (!basic_complex_p(b_arg))
4080  {
4081  call c_imag;
4082  expression exp_imag;
4083  /* CMPLX */
4086  {
4087  c_imag = make_call(make_constant_entity("0.0E0",
4088  is_basic_float, 8),
4089  NIL);
4090  }
4091  /* DCMPLX */
4092  else
4093  {
4094  c_imag = make_call(make_constant_entity("0.0D0",
4095  is_basic_float, 16),
4096  NIL);
4097  }
4098  exp_imag = make_expression(make_syntax(is_syntax_call, c_imag),
4100  call_arguments(c)
4101  = CONS(EXPRESSION, arg, CONS(EXPRESSION, exp_imag, NIL));
4102  context->number_of_simplication++;
4103  }
4104  /* CMPLX(C) -> C; DCMPLX(DC) -> DC */
4105  else if( (basic_complex(b_arg) == 8 &&
4107  (basic_complex(b_arg) == 16 &&
4109  {
4110  syntax s_tmp;
4111  normalized n_tmp;
4112  /* Argument being a call is examined in typing function */
4113  pips_assert("Argument is a call ",
4115 
4116  s_tmp = expression_syntax(exp);
4117  n_tmp = expression_normalized(exp);
4122 
4123  free_syntax(s_tmp);
4124  free_normalized(n_tmp);
4125  context->number_of_simplication++;
4126  return;
4127  }
4128  }
4129  /* Cast constants if necessary */
4130  exp_tmp = cast_constant(exp, to_basic, context);
4131  /* Number of simplifications is already counted in cast_constant() */
4132  }
4133  /* Conversion: INT (IFIX, ...), REAL (FLOAT, ...), DBLE
4134  * e.g: INT(2.9) -> 2
4135  */
4136  else
4137  {
4138  exp_tmp = cast_constant(arg, to_basic, context);
4139  /* Number of simplifications is already counted in cast_constant() */
4140  }
4141  }
4142  /* Update exp */
4143  if (exp_tmp != NULL)
4144  {
4149  expression_normalized(exp_tmp));
4150  free_expression(exp_tmp);
4151  }
4152 }
4153 
4154 static void
4156 {
4157  basic b = make_basic_int(4);
4159  free_basic(b);
4160 }
4161 static void
4163 {
4164  basic b = make_basic_float(4);
4166  free_basic(b);
4167 }
4168 static void
4170 {
4171  basic b = make_basic_float(8);
4173  free_basic(b);
4174 }
4175 static void
4177 {
4178  basic b = make_basic_complex(8);
4180  free_basic(b);
4181 }
4182 static void
4184 {
4185  basic b = make_basic_complex(16);
4187  free_basic(b);
4188 }
4189 
4190 /* Move the following functions to ri-util/type.c */
4191 
4192 type
4194 {
4195  return make_type(is_type_void, UU);
4196 }
4197 
4198 parameter
4200 {
4203  make_dummy_unknown());
4204 }
4205 
4206 //unuse
4207 type
4209 {
4210  type t = type_undefined;
4212 
4214  t = make_type(is_type_functional, ft);
4215 
4216  functional_parameters(ft) =
4218  return t;
4219 }
4220 
4221 type
4223 {
4224  type t = type_undefined;
4226 
4228  t = make_type(is_type_functional, ft);
4229 
4230  functional_parameters(ft) =
4232  return t;
4233 }
4234 
4235 type
4237 {
4238  type t = type_undefined;
4240 
4242  t = make_type(is_type_functional, ft);
4243 
4244  functional_parameters(ft) =
4246  return t;
4247 }
4248 
4249 type
4251 {
4252  type t = type_undefined;
4254 
4256  t = make_type(is_type_functional, ft);
4257 
4258  functional_parameters(ft) =
4260  return t;
4261 }
4262 
4263 type
4265 {
4266  type t = type_undefined;
4268 
4270  t = make_type(is_type_functional, ft);
4271 
4272  functional_parameters(ft) =
4274  return t;
4275 }
4276 
4279 {
4280  type t = type_undefined;
4282 
4284  t = make_type(is_type_functional, ft);
4285 
4286  functional_parameters(ft) =
4288  return t;
4289 }
4290 
4291 type
4293 {
4294  type t = type_undefined;
4296 
4298  functional_parameters(ft) =
4300  t = make_type(is_type_functional, ft);
4301 
4302  return t;
4303 }
4304 
4305 type
4307 {
4308  type t = type_undefined;
4310 
4312  functional_parameters(ft) =
4314  t = make_type(is_type_functional, ft);
4315 
4316  return t;
4317 }
4318 
4319 /******************************************************** INTRINSICS LIST */
4320 
4321 
4322 
4323 
4325 
4326 /**************************************************************************
4327  * Get the function for typing the specified intrinsic
4328  *
4329  */
4331 {
4332  return ((IntrinsicDescriptor *) hash_get(intrinsic_type_descriptor_mapping, name))->type_function;
4333 }
4334 /**************************************************************************
4335  * Get the function for switching to specific name from generic name
4336  *
4337  */
4339 {
4340  return ((IntrinsicDescriptor *) hash_get(intrinsic_type_descriptor_mapping, name))->name_function;
4341 }
4342 
4343 /* This function creates an entity that represents an intrinsic
4344  function. Fortran operators and basic statements are intrinsic
4345  functions.
4346 
4347  An intrinsic function has a rom storage, an unknown initial value and a
4348  functional type whose result and arguments have an overloaded basic
4349  type. The number of arguments is given by the IntrinsicTypeDescriptorTable
4350  data structure. */
4351 static entity MakeIntrinsic(string name, int arity, type (*intrinsic_type)(int)) {
4352  entity e;
4353 
4355  intrinsic_type(arity),
4359 
4360  return e;
4361 }
4362 
4363 /* This function creates an entity that represents an intrinsic
4364  function, if the entity does not already exist. Fortran operators
4365  and basic statements are intrinsic functions.
4366 
4367  An intrinsic function has a rom storage, an unknown initial value and a
4368  functional type whose result and arguments have an overloaded basic
4369  type. The number of arguments is given by the IntrinsicTypeDescriptorTable
4370  data structure. */
4371 entity FindOrMakeIntrinsic(string name, int arity, type (*intrinsic_type)(int))
4372 {
4374 
4375  if (entity_undefined_p(e)) {
4376  e = MakeIntrinsic(name, arity, intrinsic_type);
4377  }
4378 
4379  return e;
4380 }
4381 
4382 
4383 /** Create a default intrinsic
4384 
4385  Useful to create on-the-fly intrinsics.
4386 
4387  It creates an intrinsic with a default type, that is with overload
4388  parameter and return types.
4389 
4390  @param name is the name of the intrinsic
4391 
4392  @param n is the number of argument
4393 
4394  @return the entity of the intrinsic
4395 */
4396 entity
4397 FindOrMakeDefaultIntrinsic(string name, int arity)
4398 {
4400  if (!entity_undefined_p(e))
4401  /* It seems it has been previously created: */
4402  return e;
4403 
4404  return MakeIntrinsic(name, arity, default_intrinsic_type);
4405 }
4406 
4407 
4408 /* This function is called one time (at the very beginning) to create
4409  all intrinsic functions. */
4410 
4414 }
4415 
4416 void
4417 CreateIntrinsics( set module_list )
4418 {
4419  /* The table of intrinsic functions. this table is used at the begining
4420  of linking to create Fortran operators, commands and intrinsic functions.
4421 
4422  Functions with a variable number of arguments are declared with INT_MAX
4423  arguments.
4424  */
4425 
4426  /* Nga Nguyen 27/06/2003 Fuse the tables of intrinsics for C and Fortran.
4427  Since there are differences between some kind of operators, such as in
4428  Fortran, "+" is only applied to arithmetic numbers, in C, "+" is also applied
4429  to pointer, the typing functions are different. So in some cases, we have to
4430  rename the operators */
4431  /* Pragma can be represented in the pips IR as a list of expression so new
4432  * functions/intrinsics are needed. For exmaple to represent OMP pragmas,
4433  * following intrinscs are needed:
4434  * 1 - omp, parallel and for which are constant so with 0 argument,
4435  * 2 - the colom poperator (for reduction) that takes two arguments
4436  * 3 - private and reduction that takes a variable number of arguments.
4437  */
4438  /*
4439  * IntrinsicDescriptor need:
4440  * {Name, Nbr_arg, Type, Type_Function, switch_name_function}
4441  * \Name Name of the intrinsic operator/function
4442  * \Nbr_arg Number of argument than the intrinsic operator/function need
4443  * \Type is a pointer of function, that expect to have 1 arg (\Nbr_arg) and return a type of kind functional
4444  * \Type_Function
4445  * \switch_name_function
4446  */
4447  static IntrinsicDescriptor IntrinsicTypeDescriptorTable[] =
4448  {
4455 
4456  /* internal inverse operator... */
4459 
4461 
4464 
4468 
4475 
4477 
4478  /* FORTRAN IO statement */
4494 
4497 
4498  /* Control statement */
4500  {"ENDDO", 0, default_intrinsic_type, 0, 0}, // Why do we need this one?
4508 
4509 
4526  {DREAL_GENERIC_CONVERSION_NAME, 1, overloaded_to_double_type, /* Arnauld Leservot, code CEA */
4530 
4533 
4534  /* (0.,1.) -> switched to a function call... */
4539 
4542 
4552 
4553  //Fortran
4562 
4568 
4574 
4580 
4582 
4594 
4606 
4609 
4613 
4618 
4627 
4636 
4646 
4651 
4660 
4669 
4673 
4677 
4681 
4688 
4692 
4696 
4700 
4705 
4710 
4711  /* Bit manipulation functions : ISO/IEC 1539 */
4723 
4724  /* These operators are used within the OPTIMIZE transformation in
4725  order to manipulate operators such as n-ary add and multiply or
4726  multiply-add operators ( JZ - sept 98) */
4735 
4736  /* integer combined multiply add or sub - FC oct 2005 */
4741 
4742  /* Here are C intrinsics arranged in the order of the standard ISO/IEC 9899:TC2. MB */
4743 
4744  /* ISO 6.5.2.3 structure and union members */
4747  /* ISO 6.5.2.4 postfix increment and decrement operators, real or pointer type operand */
4750  /* ISO 6.5.3.1 prefix increment and decrement operators, real or pointer type operand */
4753  /* ISO 6.5.3.2 address and indirection operators, add pointer type */
4754  // this definition must be more precise but cause a type issue
4755  // {ADDRESS_OF_OPERATOR_NAME, 1, pointer_to_overloaded_type, 0, 0},
4758  /* ISO 6.5.3.3 unary arithmetic operators */
4760  /* Unuary minus : ALREADY EXIST (FORTRAN)
4761  {UNARY_MINUS_OPERATOR_NAME, 1, default_intrinsic_type, typing_arithmetic_operator, 0},*/
4764  /* ISO 6.5.5 multiplicative operators : ALREADY EXIST (FORTRAN)
4765  {MULTIPLY_OPERATOR_NAME, 2, default_intrinsic_type, typing_arithmetic_operator, 0},
4766  {DIVIDE_OPERATOR_NAME, 2, default_intrinsic_type, typing_arithmetic_operator, 0},*/
4768  /* ISO 6.5.6 additive operators, arithmetic types or pointer + integer type*/
4771  /* ISO 6.5.7 bitwise shift operators*/
4774  /* ISO 6.5.8 relational operators,arithmetic or pointer types */
4779  /* ISO 6.5.9 equality operators, return 0 or 1*/
4782  /* ISO 6.5.10 bitwise AND operator */
4784  /* ISO 6.5.11 bitwise exclusive OR operator */
4786  /* ISO 6.5.12 bitwise inclusive OR operator */
4788  /* ISO 6.5.13 logical AND operator */
4790  /* ISO 6.5.14 logical OR operator */
4792  /* ISO 6.5.15 conditional operator */
4794  /* ISO 6.5.16.1 simple assignment : ALREADY EXIST (FORTRAN)
4795  {ASSIGN_OPERATOR_NAME, 2, default_intrinsic_type, typing_of_assign, 0}, */
4796  /* ISO 6.5.16.2 compound assignments*/
4807  /* ISO 6.5.17 comma operator */
4808  {COMMA_OPERATOR_NAME, (INT_MAX), default_intrinsic_type, 0, 0},
4809 
4814 
4815  /* intrinsic to handle C initialization */
4817 
4818  /* #include <assert.h> */
4820  {ASSERT_FAIL_FUNCTION_NAME, 4, overloaded_to_void_type,0,0}, /* does not return */
4821 
4822  /* #include <complex.h> */
4823 
4892 
4893  /* #include <ctype.h> */
4894 
4909  /* End ctype.h */
4910  //not found in standard C99 (in GNU C Library)
4915 
4916  /* Real type is void -> unsigned short int ** */
4918 
4919  /* #include <errno.h> */
4920  /* {"errno", 0, overloaded_to_integer_type, 0, 0}, */
4921  /* bits/errno.h */
4923 
4924 
4925  /* #include <fenv.h> */
4932  // fenv_t *
4933  //{FESETENV_FUNCTION_NAME, 1, integer_to_integer_type, typing_function_int_to_int, 0},
4934  //{FEUPDATEENV_FUNCTION_NAME, 1, integer_to_integer_type, typing_function_int_to_int, 0},
4935 
4936 
4937  /* #include <float.h> */
4938  /* {"__flt_rounds", 1, void_to_integer_type, 0, 0}, */
4939 
4940  /* #include <inttypes.h> */
4943 
4944  /* #include <iso646.h> */
4945 
4946  /* {"_sysconf", 1, integer_to_integer_type, 0, 0},
4947 
4948  {"localeconv", 1, default_intrinsic_type, 0, 0},
4949  {"dcgettext", 3, default_intrinsic_type, 0, 0},
4950  {"dgettext", 2, default_intrinsic_type, 0, 0},
4951  {"gettext", 1, default_intrinsic_type, 0, 0},
4952  {"textdomain", 1, default_intrinsic_type, 0, 0},
4953  {"bindtextdomain", 2, default_intrinsic_type, 0, 0},
4954  {"wdinit", 1, void_to_integer_type, 0 ,0},
4955  {"wdchkind", 1, overloaded_to_integer_type, 0 ,0},
4956  {"wdbindf", 3, overloaded_to_integer_type, 0 ,0},
4957  {"wddelim", 3, default_intrinsic_type, 0, 0},
4958  {"mcfiller", 1, void_to_overloaded_type, 0, 0},
4959  {"mcwrap", 1, void_to_integer_type, 0 ,0},*/
4960 
4961  /* #include <limits.h> */
4962 
4963  /* #include <locale.h> */
4965 
4966  /* #include <math.h> */
4967 
5148  /* End math.h */
5149 
5153 
5157 
5160 
5182 
5183 
5184  /* same name in stdlib
5185  {"ecvt", 4, default_intrinsic_type, 0, 0},
5186  {"fcvt", 4, default_intrinsic_type, 0, 0},
5187  {"gcvt", 3, default_intrinsic_type, 0, 0},
5188  {"strtod", 2, overloaded_to_double_type, 0, 0}, */
5189 
5190  /*#include <setjmp.h>*/
5191 
5192  {"setjmp", 1, overloaded_to_integer_type, 0, 0},
5193  {"__setjmp", 1, overloaded_to_integer_type, 0, 0},
5194  {"longjmp", 2, overloaded_to_void_type, 0, 0},
5195  {"__longjmp", 2, overloaded_to_void_type, 0, 0},
5196  {"sigsetjmp", 2, overloaded_to_integer_type, 0, 0},
5197  {"siglongjmp", 2, overloaded_to_void_type, 0, 0},
5198 
5199 
5200  /*#include <signal.h>*/
5203 
5204  /*#include <stdarg.h>*/
5205  /*#include <stdbool.h>*/
5206  /*#include <stddef.h>*/
5207  /*#include <stdint.h>*/
5208  /*#include <stdio.h>*/
5209 
5224  {SCANF_FUNCTION_NAME, (INT_MAX), overloaded_to_integer_type, 0, 0},
5274  /* same name in stdlib
5275  {"getopt", 3, overloaded_to_integer_type, 0, 0},
5276  {"getsubopt", 3, default_intrinsic_type, 0, 0},*/
5289 
5290  /* C IO system functions in man -S 2. The typing could be refined. See unistd.h */
5291 
5292  {C_OPEN_FUNCTION_NAME, (INT_MAX), overloaded_to_integer_type, 0, 0}, /* 2 or 3 arguments */
5295  {C_WRITE_FUNCTION_NAME, 2, default_intrinsic_type, 0, 0}, /* returns ssize_t */
5301 
5302  /* {FCNTL_FUNCTION_NAME, (INT_MAX), overloaded_to_integer_type, 0, 0},*/ /* 2 or 3 arguments of various types*/ /* located with fcntl.h */
5305  {IOCTL_FUNCTION_NAME, (INT_MAX), overloaded_to_integer_type, 0, 0},
5311  /*#include <stdlib.h>*/
5312 
5350 
5351 
5352  //to check
5380  {RANDOM_FUNCTION_NAME, 1, default_intrinsic_type, 0, 0}, /* void -> long int */
5405 
5406  /*#include <string.h>*/
5407 
5432 
5433  /*#include <tgmath.h>*/
5434  /*#include <time.h>*/
5439  {GETTIMEOFDAY_FUNCTION_NAME, 2, overloaded_to_void_type, 0, 0}, // BSD-GNU
5442  {SECOND_FUNCTION_NAME, 0, void_to_overloaded_type, 0, 0}, //GFORTRAN
5443 
5444  /*#include <wchar.h>*/
5456  { WSCANF_FUNCTION_NAME, (INT_MAX), overloaded_to_integer_type, 0, 0},
5504 
5505  /*#include <wctype.h>*/
5506 
5525 
5526  /* netdb.h */
5528 
5529 
5530  /* #include <fcntl.h>*/
5531 
5532  {FCNTL_FUNCTION_NAME, (INT_MAX), overloaded_to_integer_type, 0, 0},
5536 
5537  /* OMP */
5544 
5545  /* BSD <err.h> */
5546  {ERR_FUNCTION_NAME, (INT_MAX), overloaded_to_void_type, 0, 0},
5547  {ERRX_FUNCTION_NAME, (INT_MAX), overloaded_to_void_type, 0, 0},
5548  {WARN_FUNCTION_NAME, (INT_MAX), overloaded_to_void_type, 0, 0},
5549  {WARNX_FUNCTION_NAME, (INT_MAX), overloaded_to_void_type, 0, 0},
5554 
5555  /* F95 */
5561 
5562  /* F2003 */
5564 
5565  /* PIPS run-time support for C code generation
5566  *
5567  * Source code located in validation/Hyperplane/run_time.src for the
5568  * time being.
5569  */
5576 
5577  /* assembly function */
5579  // The 2 last arg don't know for what
5580 
5581  /* PIPS intrinsics to simulate various effects */
5584  /*SPIRE*/
5585  {SEND_FUNCTION_NAME, (INT_MAX), overloaded_to_integer_type, 0, 0},
5586  {RECV_FUNCTION_NAME, (INT_MAX), overloaded_to_integer_type, 0, 0},
5587 
5588  /*MPI necessary calls*/
5589  //since C and Fortran MPI functions are not differentiate,
5590  // The Fortran version is consider for number of argument
5591  // (it has 1 more argument for the error handler when the C version return it)
5608 
5609  {NULL, 0, 0, 0, 0}
5610  };
5611  intrinsic_type_descriptor_mapping=hash_table_make(hash_string,sizeof(IntrinsicTypeDescriptorTable));
5612  for(IntrinsicDescriptor *p = &IntrinsicTypeDescriptorTable[0];p->name;++p) {
5613  if(!set_belong_p(module_list,p->name))
5615  }
5616 }
5617 
5618 
5619 bool bootstrap(string workspace)
5620 {
5621  pips_debug(1, "bootstraping in workspace %s\n", workspace);
5622 
5623  if (db_resource_p(DBR_ENTITIES, ""))
5624  pips_internal_error("entities already initialized");
5625 
5626  /* Create all intrinsics, skipping user-defined one */
5627  set module_list = set_make(set_string);
5629  for(int i=0; i < (int) gen_array_nitems(ml); i++)
5630  set_add_element(module_list, module_list, (char*)gen_array_item(ml,i));
5631  CreateIntrinsics(module_list);
5632  set_free(module_list);
5633  gen_array_free(ml);
5634 
5635  /* Creates the dynamic and static areas for the super global
5636  * arrays such as the logical unit array (see below).
5637  */
5638  CreateAreas();
5639 
5640  /* The current entity is unknown, but for a TOP-LEVEL:TOP-LEVEL
5641  * which is used to create the logical unit array for IO effects
5642  */
5644 
5645  /* create hidden variables to modelize the abstract states defined by the libc:
5646 
5647  seed for random function package
5648 
5649  heap abstract state
5650  */
5651  CreateRandomSeed();
5652  CreateTimeSeed();
5654  /* Create hidden variable to modelize the abstract state of :
5655  temporary arry for memmove function. Molka Becher
5656  */
5658 
5659  /* Create the empty label */
5662  LABEL_PREFIX,
5663  NULL)),
5665  make_storage_rom(),
5669 
5670  /* FI: I suppress the owner filed to make the database moveable */
5671  /* FC: the content must be consistent with pipsdbm/methods.h */
5672  DB_PUT_MEMORY_RESOURCE(DBR_ENTITIES, "", (char*) entity_domain);
5673 
5674  pips_debug(1, "bootstraping done\n");
5675 
5676  return true;
5677 }
5678 
5679 value
5681 {
5684 }
5685 
5686 string
5688  char *prefix, *base, *suffix;
5689 {
5690  char *s;
5691 
5692  s = (char*) malloc(strlen(prefix)+strlen(base)+strlen(suffix)+1);
5693 
5694  strcpy(s, prefix);
5695  strcat(s, base);
5696  strcat(s, suffix);
5697 
5698  return(s);
5699 }
5700 
5701 /* This array is pointed by FILE * pointers returned or used by fopen,
5702  fclose,... . The argument f must be the intrinsic fopen returning a
5703  FILE * or another function also returning a FILE *. So we do not
5704  have to synthesize the type FILE. */
5706 {
5708 
5709  if(type_undefined_p(entity_type(io_files))) {
5710  /* FI: this initialization is usually performed in
5711  bootstrap.c, but it is easier to do it here because the
5712  IO_FILE type does not have to be built from scratch. */
5714  type ct = copy_type(type_to_pointed_type(rt)); // FI: no risk with typedef
5715  pips_assert("ct is a scalar type",
5718  CONS(DIMENSION,
5720  /*
5721  MakeNullaryCall
5722  (CreateIntrinsic(UNBOUNDED_DIMENSION_NAME))
5723  */
5724  int_to_expression(2000),
5725  NIL),
5726  NIL);
5727  entity_type(io_files) = ct;
5730  entity_storage(io_files) =
5732  make_ram(ent,
5735  0, NIL));
5737  }
5738  return io_files;
5739 }
normalized copy_normalized(normalized p)
NORMALIZED.
Definition: ri.c:1404
void free_normalized(normalized p)
Definition: ri.c:1407
functional make_functional(list a1, type a2)
Definition: ri.c:1109
call make_call(entity a1, list a2)
Definition: ri.c:269
constant make_constant(enum constant_utype tag, void *val)
Definition: ri.c:406
basic make_basic_complex(intptr_t _field_)
Definition: ri.c:170
parameter make_parameter(type a1, mode a2, dummy a3)
Definition: ri.c:1495
expression make_expression(syntax a1, normalized a2)
Definition: ri.c:886
void free_parameter(parameter p)
Definition: ri.c:1462
mode make_mode(enum mode_utype tag, void *val)
Definition: ri.c:1350
storage make_storage_rom(void)
Definition: ri.c:2285
type copy_type(type p)
TYPE.
Definition: ri.c:2655
basic copy_basic(basic p)
BASIC.
Definition: ri.c:104
basic make_basic_overloaded(void)
Definition: ri.c:167
storage make_storage(enum storage_utype tag, void *val)
Definition: ri.c:2273
language make_language_unknown(void)
Definition: ri.c:1259
basic make_basic_int(intptr_t _field_)
Definition: ri.c:158
ram make_ram(entity a1, entity a2, intptr_t a3, list a4)
Definition: ri.c:1999
type make_type_void(list _field_)
Definition: ri.c:2727
expression copy_expression(expression p)
EXPRESSION.
Definition: ri.c:850
value make_value(enum value_utype tag, void *val)
Definition: ri.c:2832
basic make_basic_float(intptr_t _field_)
Definition: ri.c:161
dimension make_dimension(expression a1, expression a2, list a3)
Definition: ri.c:565
basic make_basic_logical(intptr_t _field_)
Definition: ri.c:164
area make_area(intptr_t a1, list a2)
Definition: ri.c:98
basic make_basic_string(value _field_)
Definition: ri.c:173
code make_code(list a1, string a2, sequence a3, list a4, language a5)
Definition: ri.c:353
call copy_call(call p)
CALL.
Definition: ri.c:233
syntax copy_syntax(syntax p)
SYNTAX.
Definition: ri.c:2442
void free_expression(expression p)
Definition: ri.c:853
constant make_constant_litteral(void)
Definition: ri.c:418
entity copy_entity(entity p)
ENTITY.
Definition: ri.c:2521
void free_syntax(syntax p)
Definition: ri.c:2445
syntax make_syntax(enum syntax_utype tag, void *val)
Definition: ri.c:2491
dummy make_dummy_unknown(void)
Definition: ri.c:617
void free_call(call p)
Definition: ri.c:236
void free_basic(basic p)
Definition: ri.c:107
mode make_mode_value(void)
Definition: ri.c:1353
sequence make_sequence(list a)
Definition: ri.c:2125
qualifier make_qualifier_const(void)
Definition: ri.c:1924
bool type_consistent_p(type p)
Definition: ri.c:2664
type make_type(enum type_utype tag, void *val)
Definition: ri.c:2706
bool db_resource_p(const char *rname, const char *oname)
true if exists and in loaded or stored state.
Definition: database.c:524
static int count
Definition: SDG.c:519
void const char const char const int
size_t gen_array_nitems(const gen_array_t a)
Definition: array.c:131
void * gen_array_item(const gen_array_t a, size_t i)
Definition: array.c:143
void gen_array_free(gen_array_t a)
Definition: array.c:70
bdt base
Current expression.
Definition: bdt_read_paf.c:100
#define DOUBLE_LENGTH
#define REAL_LENGTH
basic(* typing_function_t)(call, type_context_p)
#define INT_LENGTH
should be some properties to accomodate cray codes??
void(* switch_name_function)(expression, type_context_p)
static void switch_specific_dcmplx(expression exp, type_context_p context)
Definition: bootstrap.c:3981
static void switch_specific_asin(expression exp, type_context_p context)
ASIN.
Definition: bootstrap.c:3916
static basic typing_function_real_to_double(call c, type_context_p context)
Definition: bootstrap.c:2471
static type double_to_integer_type(int n)
Definition: bootstrap.c:691
static bool arguments_are_longdcomplex(call c, hash_table types)
MB.
Definition: bootstrap.c:1746
bool check_loop_range(range, hash_table)
Definition: type_checker.c:292
static type overloaded_to_double_type(int n)
Definition: bootstrap.c:404
static bool check_spec(string name, bool allowed, const char *specifier, expression contents, type_context_p context, bool(*check_contents)(expression, type_context_p))
Definition: bootstrap.c:3474
void CreateAreas()
cproto-generated files
Definition: bootstrap.c:104
static basic typing_function_real_to_real(call c, type_context_p context)
Definition: bootstrap.c:2246
static void switch_generic_to_specific(expression exp, type_context_p context, string arg_int_name, string arg_real_name, string arg_double_name, string arg_complex_name, string arg_dcomplex_name)
Definition: bootstrap.c:3748
static basic typing_function_complex_to_real(call c, type_context_p context)
Definition: bootstrap.c:2483
static basic typing_function_overloaded(call __attribute__((unused)) c, type_context_p __attribute__((unused)) context)
Definition: bootstrap.c:2772
static basic check_close(call c, type_context_p context)
Definition: bootstrap.c:3636
static call convert_constant_from_double_to_dcomplex(call c)
DOUBLE -> DCOMPLEX e.g: DCMPLX(-5.9D5) => (-5.9D5, 0.0)
Definition: bootstrap.c:1207
static call convert_constant_from_real_to_double(call c)
REAL -> DOUBLE e.g: DBLE(-5.9E-2) => -5.9D-2.
Definition: bootstrap.c:1101
static call convert_constant_from_real_to_dcomplex(call c)
REAL -> DCOMPLEX e.g: DCMPLX(-5.9E5) => (-5.9D5, 0.0D0)
Definition: bootstrap.c:1232
static basic typing_buffer_inout(call c, type_context_p context)
Definition: bootstrap.c:2926
static void switch_specific_max(expression exp, type_context_p context)
MAX.
Definition: bootstrap.c:3853
static basic typing_substring(call c, type_context_p context)
Definition: bootstrap.c:2815
type __attribute__((unused))
Package : C3/union Author : Arnauld LESERVOT (leservot(a)limeil.cea.fr) Date : Modified : 04 04 95 ...
Definition: bootstrap.c:4277
static void CreateRandomSeed()
Definition: bootstrap.c:292
static bool arguments_are_longinteger(call c, hash_table types)
MB.
Definition: bootstrap.c:1710
static basic typing_implied_do(call c, type_context_p context)
Definition: bootstrap.c:2980
static type complex_to_real_type(int n)
Definition: bootstrap.c:849
#define TC_LONGDCOMPLEX
MB : Type check long double complex.
Definition: bootstrap.c:1609
static type real_to_integer_type(int n)
Definition: bootstrap.c:626
static bool arguments_are_IR(call c, type_context_p context)
Definition: bootstrap.c:1933
static bool arguments_are_IRDC(call c, type_context_p context)
Definition: bootstrap.c:1908
static basic typing_logical_operator(call c, type_context_p context)
Definition: bootstrap.c:2107
static call convert_constant_from_int_to_dcomplex(call c)
INT -> DCOMPLEX e.g: DCMPLX(-5) => (-5D0, 0.0D0)
Definition: bootstrap.c:1242
static bool check_if_basics_ok(list le, hash_table types, bool(*basic_ok)(basic))
Verify if all the arguments basic of function C are INTEGER If there is no argument,...
Definition: bootstrap.c:1644
static entity get_cast_function_for_basic(basic cast, basic from)
Definition: bootstrap.c:1495
type longinteger_to_overloaded_type(int n)
MB.
Definition: bootstrap.c:4236
static basic typing_function_constant_complex(call c, type_context_p context)
CMPLX_.
Definition: bootstrap.c:2738
static basic typing_function_dcomplex_to_double(call c, type_context_p context)
Definition: bootstrap.c:2495
static bool arguments_are_IRDCS(call c, type_context_p context)
Definition: bootstrap.c:1901
type overloaded_to_void_type(int n)
Definition: bootstrap.c:4292
static type real_to_longlonginteger_type(int n)
MB.
Definition: bootstrap.c:678
static basic typing_function_longdouble_to_longint(call c, type_context_p context)
MB.
Definition: bootstrap.c:2446
static basic check_backspace(call c, type_context_p context)
Definition: bootstrap.c:3671
static basic typing_function_double_to_int(call c, type_context_p context)
Definition: bootstrap.c:2398
static call convert_constant_from_int_to_double(call c)
INT -> DOUBLE e.g: DBLE(10) => 10.0.
Definition: bootstrap.c:1075
static bool is_opened_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3393
#define TC_DCOMPLEX
Type check double complex?
Definition: bootstrap.c:1605
void CreateIntrinsics(set module_list)
Definition: bootstrap.c:4417
type MakeVoidResult()
Move the following functions to ri-util/type.c.
Definition: bootstrap.c:4193
static basic typing_function_RealDouble_to_RealDouble(call c, type_context_p context)
Definition: bootstrap.c:2523
static bool is_basic_longdcomplex_p(basic b)
MB.
Definition: bootstrap.c:1699
static type longinteger_to_longinteger_type(int n)
MB.
Definition: bootstrap.c:733
static basic no_typing(call __attribute__((unused)) c, type_context_p __attribute__((unused)) context)
Definition: bootstrap.c:2971
static bool is_file_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3348
static bool arguments_are_complex(call c, hash_table types)
Definition: bootstrap.c:1736
static type integer_to_logical_type(int n)
to handle BTEST function which takes integer as parameter and returns logical.
Definition: bootstrap.c:490
static void CreateHeapAbstractState()
Definition: bootstrap.c:310
static list make_parameter_list(int n, parameter(*mkprm)(void))
Definition: bootstrap.c:329
static void switch_specific_tan(expression exp, type_context_p context)
TAN.
Definition: bootstrap.c:3909
static bool is_named_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3411
static basic typing_function_RealDouble_to_Integer(call c, type_context_p context)
Definition: bootstrap.c:2540
static bool is_err_specifier(expression exp, type_context_p context)
Error specifier is a label statement.
Definition: bootstrap.c:3336
static basic typing_function_longdouble_to_longlongint(call c, type_context_p context)
MB.
Definition: bootstrap.c:2459
switch_name_function get_switch_name_function_for_intrinsic(const char *name)
Definition: bootstrap.c:4338
static basic check_rewind(call c, type_context_p context)
Definition: bootstrap.c:3703
static hash_table intrinsic_type_descriptor_mapping
Definition: bootstrap.c:4324
static type overloaded_to_real_type(int n)
Definition: bootstrap.c:390
static void simplification_conversion(expression exp, basic to_basic, type_context_p context)
Definition: bootstrap.c:3999
static basic typing_function_int_to_int(call c, type_context_p context)
Definition: bootstrap.c:2219
static void switch_specific_sinh(expression exp, type_context_p context)
SINH.
Definition: bootstrap.c:3944
static type longdouble_to_longdouble_type(int n)
MB.
Definition: bootstrap.c:834
static basic typing_function_longdouble_to_int(call c, type_context_p context)
MB.
Definition: bootstrap.c:2433
static basic check_endfile(call c, type_context_p context)
Definition: bootstrap.c:3687
type pointer_to_overloaded_type(int n)
Definition: bootstrap.c:4208
static bool is_sequential_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3429
static bool is_record_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3316
static bool is_basic_int_p(basic b)
Definition: bootstrap.c:1659
static type longdoublecomplex_to_longdoublecomplex_type(int n)
MB.
Definition: bootstrap.c:903
static call convert_constant_from_double_to_complex(call c)
DOUBLE -> COMPLEX e.g: CMPLX(-5.9D5) => (-5.9E5, 0.0)
Definition: bootstrap.c:1187
static bool arguments_are_longdouble(call c, hash_table types)
MB.
Definition: bootstrap.c:1731
static bool is_format_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3310
static basic check_read_write(call c, type_context_p context)
Definition: bootstrap.c:3603
static basic typing_function_int_to_real(call c, type_context_p context)
Definition: bootstrap.c:2370
static void switch_specific_mod(expression exp, type_context_p context)
MOD.
Definition: bootstrap.c:3832
static basic typing_function_RealDoubleComplex_to_RealDoubleComplex(call c, type_context_p context)
Definition: bootstrap.c:2558
static type double_to_longlonginteger_type(int n)
MB.
Definition: bootstrap.c:719
static basic typing_function_IntegerRealDouble_to_IntegerRealDouble(call c, type_context_p context)
Definition: bootstrap.c:2576
static basic typing_function_char_to_logical(call c, type_context_p context)
Definition: bootstrap.c:2507
static type overloaded_to_doublecomplex_type(int n)
Definition: bootstrap.c:446
static basic typing_function_double_to_double(call c, type_context_p context)
Definition: bootstrap.c:2255
type integer_to_void_type(int n)
Definition: bootstrap.c:4264
static bool is_iostat_specifier(expression exp, type_context_p context)
Integer variable or integer array element which is maybe modified.
Definition: bootstrap.c:3324
static void switch_specific_dim(expression exp, type_context_p context)
DIM.
Definition: bootstrap.c:3846
static basic typing_function_conversion_to_complex(call c, type_context_p context)
Definition: bootstrap.c:2669
static basic typing_function_format_name(call __attribute__((unused)) c, type_context_p __attribute__((unused)) context)
Definition: bootstrap.c:2779
static basic typing_function_argument_type_to_return_type(call c, type_context_p context, basic from_type, basic to_type)
Definition: bootstrap.c:2135
static bool is_basic_complex_p(basic b)
Definition: bootstrap.c:1689
static void simplification_dcomplex(expression, type_context_p)
Definition: bootstrap.c:4183
static type char_pointer_to_double_type(int n __attribute__((unused)))
C only because of pointer.
Definition: bootstrap.c:573
type integer_to_overloaded_type(int n)
Definition: bootstrap.c:4222
static basic typing_function_longdcomplex_to_longdouble(call c, type_context_p context)
MB.
Definition: bootstrap.c:2300
static bool arguments_are_IRD(call c, type_context_p context)
Definition: bootstrap.c:1939
static void switch_specific_log10(expression exp, type_context_p context)
LOG10.
Definition: bootstrap.c:3888
static type default_intrinsic_type(int n)
The default intrinsic type is a functional type with n overloaded arguments returning an overloaded r...
Definition: bootstrap.c:362
static type longdouble_to_longlonginteger_type(int n)
MB.
Definition: bootstrap.c:819
static void switch_specific_anint(expression exp, type_context_p context)
ANINT.
Definition: bootstrap.c:3811
static bool is_end_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3342
static bool is_basic_longint_p(basic b)
MB.
Definition: bootstrap.c:1664
static basic typing_arithmetic_operator(call c, type_context_p context)
Definition: bootstrap.c:2020
static void switch_specific_aint(expression exp, type_context_p context)
AINT.
Definition: bootstrap.c:3804
static void switch_specific_min(expression exp, type_context_p context)
MIN.
Definition: bootstrap.c:3860
typing_function_t get_typing_function_for_intrinsic(const char *name)
Definition: bootstrap.c:4330
static call convert_constant_from_double_to_real(call c)
DOUBLE -> REAL e.g: REAL(-5.9D-2) => -5.9E-2.
Definition: bootstrap.c:1127
static bool is_basic_longlongint_p(basic b)
MB.
Definition: bootstrap.c:1669
static basic basic_union_arguments(call c, hash_table types)
Determine the longest basic among the arguments of c.
Definition: bootstrap.c:1615
static type substring_type(int n)
Definition: bootstrap.c:973
static bool is_nextrec_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3465
static basic statement_with_at_most_one_expression_integer(call c, type_context_p context)
Definition: bootstrap.c:3153
static void switch_specific_atan(expression exp, type_context_p context)
ATAN.
Definition: bootstrap.c:3930
static basic typing_function_real_to_longint(call c, type_context_p context)
MB.
Definition: bootstrap.c:2346
static type real_to_real_type(int n)
Definition: bootstrap.c:639
static bool is_basic_real_p(basic b)
Definition: bootstrap.c:1674
static type character_to_logical_type(int n)
Definition: bootstrap.c:945
static bool arguments_are_integer(call c, hash_table types)
Definition: bootstrap.c:1705
static void simplification_real(expression exp, type_context_p context)
Definition: bootstrap.c:4162
#define GET_TYPE(h, e)
Working with hash_table of basic.
Definition: bootstrap.c:89
static type integer_to_real_type(int n)
Definition: bootstrap.c:598
static type doublecomplex_to_doublecomplex_type(int n)
Definition: bootstrap.c:889
static type assign_substring_type(int n)
Definition: bootstrap.c:995
string MakeFileName(char *prefix, char *base, char *suffix)
Definition: bootstrap.c:5687
static void CreateMemmoveAbstractState()
Definition: bootstrap.c:319
static bool is_formated_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3447
static bool is_exist_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3384
static bool is_access_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3360
static basic typing_function_longint_to_longint(call c, type_context_p context)
MB.
Definition: bootstrap.c:2228
static bool arguments_are_RDC(call c, type_context_p context)
Definition: bootstrap.c:1954
static basic typing_function_longlongint_to_longlongint(call c, type_context_p context)
MB.
Definition: bootstrap.c:2237
static void switch_specific_log(expression exp, type_context_p context)
LOG.
Definition: bootstrap.c:3881
static type void_to_void_to_int_pointer_type(int n __attribute__((unused)))
C only because of pointer.
Definition: bootstrap.c:551
static basic statement_with_at_most_one_integer_or_character(call c, type_context_p context)
Definition: bootstrap.c:3100
static bool is_recl_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3372
static basic typing_function_conversion_to_real(call c, type_context_p context)
Definition: bootstrap.c:2653
static void switch_specific_sqrt(expression exp, type_context_p context)
SQRT.
Definition: bootstrap.c:3867
static basic typing_function_int_to_logical(call c, type_context_p context)
function added to handle one of the bit manipulation functions : BTEST.
Definition: bootstrap.c:2385
static basic typing_of_assign(call c, type_context_p context)
Definition: bootstrap.c:2786
#define PUT_TYPE(h, e, b)
Definition: bootstrap.c:90
static bool is_form_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3366
static basic typing_power_operator(call c, type_context_p context)
Definition: bootstrap.c:2041
static basic typing_function_constant_dcomplex(call c, type_context_p context)
DCMPLX_.
Definition: bootstrap.c:2755
static basic check_inquire(call c, type_context_p context)
Definition: bootstrap.c:3653
static bool is_number_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3402
static void simplification_complex(expression, type_context_p)
forward declarations
Definition: bootstrap.c:4176
static type longdouble_to_integer_type(int n)
MB.
Definition: bootstrap.c:791
static bool arguments_are_something(call c, type_context_p context, bool integer_ok, bool longinteger_ok, bool longlonginteger_ok, bool real_ok, bool double_ok, bool longdouble_ok, bool complex_ok, bool dcomplex_ok, bool longdcomplex_ok, bool logical_ok, bool character_ok)
Molka Becher: add of long int, long long int, long double and long double complex types.
Definition: bootstrap.c:1762
static bool is_unit_specifier(expression exp, type_context_p context)
This function verifies the unit specifier; that is integer positive expression or character expressio...
Definition: bootstrap.c:3292
static entity CreateAbstractStateVariable(string pn, string vn)
added to handle xxxrandxxx functions.
Definition: bootstrap.c:236
void register_intrinsic_type_descriptor(IntrinsicDescriptor *p)
This function is called one time (at the very beginning) to create all intrinsic functions.
Definition: bootstrap.c:4411
static bool is_label_integer_string_specifier(string s, expression e, type_context_p context)
Definition: bootstrap.c:3252
static void switch_specific_nint(expression exp, type_context_p context)
NINT.
Definition: bootstrap.c:3818
static bool is_string_specifier(string s, expression e, type_context_p context)
Definition: bootstrap.c:3236
static bool is_integer_specifier(string s, expression e, type_context_p context)
Definition: bootstrap.c:3219
static basic typing_function_double_to_longlongint(call c, type_context_p context)
MB.
Definition: bootstrap.c:2422
static type double_to_double_type(int n)
Definition: bootstrap.c:777
static basic typing_assign_substring(call c, type_context_p context)
Definition: bootstrap.c:2867
static basic typing_function_real_to_int(call c, type_context_p context)
Definition: bootstrap.c:2334
static type logical_to_logical_type(int n)
Definition: bootstrap.c:1020
static bool check_io_list(list args, type_context_p ctxt, bool a_unit, bool a_fmt, bool a_rec, bool a_iostat, bool a_err, bool a_end, bool a_iolist, bool a_file, bool a_status, bool a_access, bool a_form, bool a_blank, bool a_recl, bool a_exist, bool a_opened, bool a_number, bool a_named, bool a_name, bool a_sequential, bool a_direct, bool a_formatted, bool a_unformatted, bool a_nextrec)
Definition: bootstrap.c:3504
static type unsigned_integer_to_void_pointer_type(int n)
Definition: bootstrap.c:517
static basic check_format(call c, type_context_p context)
Definition: bootstrap.c:3719
static basic typing_function_conversion_to_numeric(call c, type_context_p context, basic to_type)
Definition: bootstrap.c:2635
static call convert_constant_from_int_to_real(call c)
Definition: bootstrap.c:1063
static basic typing_function_dcomplex_to_dcomplex(call c, type_context_p context)
Definition: bootstrap.c:2282
static bool is_direct_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3438
static bool arguments_are_character(call c, type_context_p context)
Definition: bootstrap.c:1914
static basic typing_function_longdouble_to_longdouble(call c, type_context_p context)
MB.
Definition: bootstrap.c:2264
static void simplification_int(expression exp, type_context_p context)
Definition: bootstrap.c:4155
static type void_to_void_type(int n __attribute__((unused)))
Can be used for C or Fortran functions.
Definition: bootstrap.c:531
static type longdouble_to_longinteger_type(int n)
MB.
Definition: bootstrap.c:805
static bool is_blank_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3378
static entity MakeIntrinsic(string name, int arity, type(*intrinsic_type)(int))
This function creates an entity that represents an intrinsic function.
Definition: bootstrap.c:4351
static bool arguments_are_longlonginteger(call c, hash_table types)
MB.
Definition: bootstrap.c:1715
static type character_to_integer_type(int n)
Definition: bootstrap.c:931
static type overloaded_to_complex_type(int n)
Definition: bootstrap.c:432
static bool is_label_statement(expression exp)
Definition: bootstrap.c:3189
entity FindOrMakeDefaultIntrinsic(string name, int arity)
Create a default intrinsic.
Definition: bootstrap.c:4397
type void_to_integer_type(int n)
Definition: bootstrap.c:4306
static void switch_specific_cos(expression exp, type_context_p context)
COS.
Definition: bootstrap.c:3902
static type longlonginteger_to_longlonginteger_type(int n)
MB.
Definition: bootstrap.c:747
static basic typing_function_char_to_int(call c, type_context_p context)
Definition: bootstrap.c:2311
type longlonginteger_to_overloaded_type(int n)
MB.
Definition: bootstrap.c:4250
static void switch_specific_sign(expression exp, type_context_p context)
SIGN.
Definition: bootstrap.c:3839
static void typing_arguments(call c, type_context_p context, basic b)
Definition: bootstrap.c:1996
static basic typing_function_conversion_to_double(call c, type_context_p context)
Definition: bootstrap.c:2661
static type overloaded_to_logical_type(int n)
type t = type_undefined; functional ft = functional_undefined;
Definition: bootstrap.c:474
entity FindOrMakeIntrinsic(string name, int arity, type(*intrinsic_type)(int))
This function creates an entity that represents an intrinsic function, if the entity does not already...
Definition: bootstrap.c:4371
static type double_to_longinteger_type(int n)
MB.
Definition: bootstrap.c:705
static basic typing_relational_operator(call c, type_context_p context)
Definition: bootstrap.c:2085
entity MakeIoFileArray(entity f)
This array is pointed by FILE * pointers returned or used by fopen, fclose,...
Definition: bootstrap.c:5705
static bool is_name_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3420
static void simplification_double(expression exp, type_context_p context)
Definition: bootstrap.c:4169
static type overloaded_to_integer_type(int n)
Definition: bootstrap.c:376
static bool is_constant(expression exp)
Verify if an expression is a constant: YES : return true; otherwise, return FALSE.
Definition: bootstrap.c:3046
static call convert_constant_from_double_to_int(call c)
DOUBLE -> INT e.g: INT(-5.9D2) => -590.
Definition: bootstrap.c:1153
static basic check_open(call c, type_context_p context)
Definition: bootstrap.c:3620
expression insert_cast(basic cast, basic from, expression exp, type_context_p)
Function in type_checker.c.
Definition: bootstrap.c:1567
bool arguments_are_compatible(call c, hash_table types)
Definition: bootstrap.c:1965
static void switch_specific_cosh(expression exp, type_context_p context)
COSH.
Definition: bootstrap.c:3951
static bool arguments_are_double(call c, hash_table types)
Definition: bootstrap.c:1726
void type_loop_range(basic, range, type_context_p)
Definition: bootstrap.c:1038
static bool is_status_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3354
static basic typing_function_longdcomplex_to_longdcomplex(call c, type_context_p context)
B: added for long double complex type.
Definition: bootstrap.c:2291
bool bootstrap(string workspace)
Definition: bootstrap.c:5619
static bool arguments_are_real(call c, hash_table types)
Definition: bootstrap.c:1721
static basic typing_function_real_to_longlongint(call c, type_context_p context)
MB.
Definition: bootstrap.c:2358
static type real_to_longinteger_type(int n)
MB.
Definition: bootstrap.c:665
static basic typing_function_complex_to_complex(call c, type_context_p context)
Definition: bootstrap.c:2273
static bool arguments_are_logical(call c, type_context_p context)
Definition: bootstrap.c:1920
static type real_to_double_type(int n)
Definition: bootstrap.c:652
static basic statement_without_argument(call c, type_context_p context)
Definition: bootstrap.c:3079
static void CreateTimeSeed()
Definition: bootstrap.c:300
static call convert_constant_from_int_to_complex(call c)
INT -> COMPLEX e.g: CMPLX(-5) => (-5.0, 0.0)
Definition: bootstrap.c:1197
static bool arguments_are_dcomplex(call c, hash_table types)
Definition: bootstrap.c:1741
static type longdoublecomplex_to_longdouble_type(int n)
MB.
Definition: bootstrap.c:917
static void switch_specific_sin(expression exp, type_context_p context)
SIN.
Definition: bootstrap.c:3895
static basic typing_concat_operator(call c, type_context_p context)
Definition: bootstrap.c:2120
value MakeValueLitteral()
Definition: bootstrap.c:5680
static bool is_basic_longdouble_p(basic b)
MB.
Definition: bootstrap.c:1684
static bool is_label_specifier(string s, expression e, type_context_p context)
Definition: bootstrap.c:3204
static call convert_constant_from_real_to_int(call c)
REAL -> INT e.g: INT(-5.9E2) => -590.
Definition: bootstrap.c:1087
static type complex_to_complex_type(int n)
Definition: bootstrap.c:876
static void CreateLogicalUnits()
Definition: bootstrap.c:122
static bool is_varibale_array_element_specifier(string s, expression e, basic b, type_context_p context)
Definition: bootstrap.c:3270
static basic typing_function_int_to_char(call c, type_context_p context)
Definition: bootstrap.c:2322
static type overloaded_to_longdouble_type(int n)
MB.
Definition: bootstrap.c:418
static void switch_specific_tanh(expression exp, type_context_p context)
TANH.
Definition: bootstrap.c:3958
static void switch_specific_atan2(expression exp, type_context_p context)
ATAN2.
Definition: bootstrap.c:3937
static type character_to_character_type(int n)
Definition: bootstrap.c:959
static basic typing_function_IntegerRealDoubleComplex_to_IntegerRealDoubleReal(call c, type_context_p context)
Definition: bootstrap.c:2600
static bool is_basic_double_p(basic b)
Definition: bootstrap.c:1679
static call convert_constant_from_real_to_complex(call c)
REAL -> COMPLEX e.g: CMPLX(-5.9E5) => (-5.9E5, 0.0)
Definition: bootstrap.c:1163
static void switch_specific_abs(expression exp, type_context_p context)
ABS.
Definition: bootstrap.c:3825
static basic typing_function_conversion_to_integer(call c, type_context_p context)
Definition: bootstrap.c:2645
static bool arguments_are_RD(call c, type_context_p context)
Definition: bootstrap.c:1926
static type integer_to_integer_type(int n)
Why do we make these functions static and keep them here instead of populating ri-util/type....
Definition: bootstrap.c:505
call convert_constant(call c, basic to_basic)
Definition: bootstrap.c:1253
static bool is_basic_dcomplex_p(basic b)
Definition: bootstrap.c:1694
static void switch_specific_cmplx(expression exp, type_context_p context)
Definition: bootstrap.c:3969
static type doublecomplex_to_double_type(int n)
Definition: bootstrap.c:862
static basic typing_function_double_to_longint(call c, type_context_p context)
MB.
Definition: bootstrap.c:2410
expression cast_constant(expression exp_constant, basic to_basic, type_context_p context)
Definition: bootstrap.c:1343
static basic typing_function_conversion_to_dcomplex(call c, type_context_p context)
Definition: bootstrap.c:2703
static void switch_specific_exp(expression exp, type_context_p context)
EXP.
Definition: bootstrap.c:3874
static void switch_specific_acos(expression exp, type_context_p context)
ACOS.
Definition: bootstrap.c:3923
static bool is_constant_of_basic(expression exp, basic b)
Verify if an expression is a constant of basic b: YES : return true; otherwise, return FALSE.
Definition: bootstrap.c:3060
parameter MakeVoidParameter()
Definition: bootstrap.c:4199
static bool is_unformated_specifier(expression exp, type_context_p context)
Definition: bootstrap.c:3456
type void_to_overloaded_type(int)
entity make_constant_entity(string name, tag bt, size_t size)
For historical reason, call the Fortran version.
Definition: constant.c:301
bool get_bool_property(const string)
FC 2015-07-20: yuk, moved out to prevent an include cycle dependency include "properties....
void * malloc(YYSIZE_T)
void reset_current_module_entity(void)
Reset the current module entity.
Definition: static.c:97
entity set_current_module_entity(entity)
static.c
Definition: static.c:66
entity get_current_module_entity(void)
Get the entity of the current module.
Definition: static.c:85
bool gen_true2(__attribute__((unused)) gen_chunk *u1, __attribute__((unused)) void *u2)
Definition: genClib.c:2785
#define ENDP(l)
Test if a list is empty.
Definition: newgen_list.h:66
#define NIL
The empty list (nil in Lisp)
Definition: newgen_list.h:47
size_t gen_length(const list l)
Definition: list.c:150
#define CONS(_t_, _i_, _l_)
List element cell constructor (insert an element at the beginning of a list)
Definition: newgen_list.h:150
#define CAR(pcons)
Get the value of the first element of a list.
Definition: newgen_list.h:92
#define FOREACH(_fe_CASTER, _fe_item, _fe_list)
Apply/map an instruction block on all the elements of a list.
Definition: newgen_list.h:179
#define CDR(pcons)
Get the list less its first element.
Definition: newgen_list.h:111
#define MAP(_map_CASTER, _map_item, _map_code, _map_list)
Apply/map an instruction block on all the elements of a list (old fashioned)
Definition: newgen_list.h:226
gen_array_t db_get_module_list(void)
Get an array of all the modules (functions, procedures and compilation units) of a workspace.
Definition: database.c:1266
#define DB_PUT_MEMORY_RESOURCE(res_name, own_name, res_val)
conform to old interface.
Definition: pipsdbm-local.h:66
void add_one_line_of_comment(statement, string,...)
Definition: statement.c:1940
hash_table hash_table_make(hash_key_type key_type, size_t size)
Definition: hash.c:294
void * hash_get(const hash_table htp, const void *key)
this function retrieves in the hash table pointed to by htp the couple whose key is equal to key.
Definition: hash.c:449
void hash_put(hash_table htp, const void *key, const void *val)
This functions stores a couple (key,val) in the hash table pointed to by htp.
Definition: hash.c:364
bool hash_defined_p(const hash_table htp, const void *key)
true if key has e value in htp.
Definition: hash.c:484
#define pips_debug
these macros use the GNU extensions that allow variadic macros, including with an empty list.
Definition: misc-local.h:145
#define pips_assert(what, predicate)
common macros, two flavors depending on NDEBUG
Definition: misc-local.h:172
#define pips_internal_error
Definition: misc-local.h:149
#define LABEL_PREFIX
Definition: naming-local.h:31
#define DYNAMIC_AREA_LOCAL_NAME
Definition: naming-local.h:69
#define LIST_DIRECTED_FORMAT_NAME
Definition: naming-local.h:97
#define TOP_LEVEL_MODULE_NAME
Module containing the global variables in Fortran and C.
Definition: naming-local.h:101
#define STATIC_AREA_LOCAL_NAME
Definition: naming-local.h:70
#define MODULE_SEP_STRING
Definition: naming-local.h:30
string concatenate(const char *,...)
Return the concatenation of the given strings.
Definition: string.c:183
@ hash_string
Definition: newgen_hash.h:32
#define hash_table_undefined
Value of an undefined hash_table.
Definition: newgen_hash.h:49
#define same_string_p(s1, s2)
void set_free(set)
Definition: set.c:332
bool set_belong_p(const set, const void *)
Definition: set.c:194
@ set_string
Definition: newgen_set.h:42
set set_make(set_type)
Create an empty set of any type but hash_private.
Definition: set.c:102
set set_add_element(set, const set, const void *)
Definition: set.c:152
void * stack_head(const stack)
returns the item on top of stack s
Definition: stack.c:420
#define UU
Definition: newgen_types.h:98
int f(int off1, int off2, int n, float r[n], float a[n], float b[n])
Definition: offsets.c:15
string basic_to_string(basic)
Definition: type.c:87
static const char * prefix
#define UNBOUNDED_DIMENSION_NAME
Definition: ri-util-local.h:74
#define GETS_FUNCTION_NAME
#define ERFCL_OPERATOR_NAME
#define ERFC_OPERATOR_NAME
#define BITWISE_OR_OPERATOR_NAME
#define FREAD_FUNCTION_NAME
#define ALLOCA_FUNCTION_NAME
#define WCSFTIME_FUNCTION_NAME
#define NINT_CONVERSION_NAME
#define ATAN2_OPERATOR_NAME
#define SGCONVERT_OPERATOR_NAME
#define FWSCANF_FUNCTION_NAME
#define LDEXPL_OPERATOR_NAME
#define QECONVERT_OPERATOR_NAME
#define CREALF_OPERATOR_NAME
#define FESETEXCEPTFLAG_FUNCTION_NAME
#define VFPRINTF_FUNCTION_NAME
#define EXPM1L_OPERATOR_NAME
#define C_TANH_OPERATOR_NAME
#define CTANHF_OPERATOR_NAME
#define LABS_FUNCTION_NAME
#define FUNC_TO_DECIMAL_OPERATOR_NAME
#define C_WRITE_FUNCTION_NAME
#define DREAL_GENERIC_CONVERSION_NAME
#define SRAND_FUNCTION_NAME
#define FGETWC_FUNCTION_NAME
#define CASINL_OPERATOR_NAME
#define MAX_OPERATOR_NAME
#define POWER_OPERATOR_NAME
#define ATOI_FUNCTION_NAME
#define LLE_OPERATOR_NAME
#define DECIMAL_TO_SINGLE_OPERATOR_NAME
#define _TOLOWER_OPERATOR_NAME
#define ATANL_OPERATOR_NAME
#define CABS_OPERATOR_NAME
#define REALLOC_FUNCTION_NAME
#define LOGB_OPERATOR_NAME
#define WCSRCHR_FUNCTION_NAME
#define CPROJ_OPERATOR_NAME
#define WCSTOMBS_FUNCTION_NAME
#define FGETC_FUNCTION_NAME
#define GETLOGIN_FUNCTION_NAME
#define LOG1P_OPERATOR_NAME
#define STRLEN_FUNCTION_NAME
#define TOWUPPER_OPERATOR_NAME
#define POST_DECREMENT_OPERATOR_NAME
Definition: ri-util-local.h:98
#define MBSINIT_FUNCTION_NAME
#define CPU_TIME_FUNCTION_NAME
#define DTIME_FUNCTION_NAME
#define NEXTAFTERF_OPERATOR_NAME
#define STAT_FUNCTION_NAME
#define MEMSET_FUNCTION_NAME
#define CEXP_OPERATOR_NAME
#define CPOWL_OPERATOR_NAME
#define RECV_FUNCTION_NAME
#define FDATASYNC_FUNCTION_NAME
#define IDNINT_CONVERSION_NAME
#define FWRITE_FUNCTION_NAME
#define SWPRINTF_FUNCTION_NAME
#define MBTOWC_FUNCTION_NAME
#define MEMALIGN_FUNCTION_NAME
#define FLOAT_GENERIC_CONVERSION_NAME
#define ISOC99_VFSCANF_FUNCTION_NAME
#define TTYNAME_FUNCTION_NAME
#define RAND_GEN_EFFECTS_NAME
variable name for random unit
#define TOLOWER_OPERATOR_NAME
#define BITWISE_XOR_OPERATOR_NAME
#define STRSPN_FUNCTION_NAME
#define FGETPOS_FUNCTION_NAME
#define C_LESS_OR_EQUAL_OPERATOR_NAME
#define REPEAT_VALUE_NAME
Definition: ri-util-local.h:77
#define NANL_OPERATOR_NAME
#define SEED48_FUNCTION_NAME
#define TANH_OPERATOR_NAME
#define REMAINDERF_OPERATOR_NAME
#define CREAT64_FUNCTION_NAME
#define IMAXDIV_FUNCTION_NAME
#define FMINF_OPERATOR_NAME
#define STRCMP_FUNCTION_NAME
#define CACOSH_OPERATOR_NAME
#define NEARBYINTF_OPERATOR_NAME
#define VALLOC_FUNCTION_NAME
#define SETSTATE_FUNCTION_NAME
#define RAND_EFFECTS_PACKAGE_NAME
package name for random routines
#define COS_OPERATOR_NAME
#define __FILBUF_FUNCTION_NAME
#define C_EXP_OPERATOR_NAME
#define CDABS_OPERATOR_NAME
#define DSIGN_OPERATOR_NAME
#define SCANF_FUNCTION_NAME
#define TIME_EFFECTS_PACKAGE_NAME
package name for time routines
#define COPYSIGNF_OPERATOR_NAME
#define WCSRTOMBS_FUNCTION_NAME
#define ISWALNUM_OPERATOR_NAME
include <wctype.h>
#define MRAND48_FUNCTION_NAME
#define FSYNC_FUNCTION_NAME
fcntl is declared with fcntl.h
#define FTELLO64_FUNCTION_NAME
#define DOUBLE_MODULO_OPERATOR_NAME
#define READ_FUNCTION_NAME
#define ISLOWER_OPERATOR_NAME
#define STRNCPY_FUNCTION_NAME
#define C_ACOSH_OPERATOR_NAME
#define CTANHL_OPERATOR_NAME
#define FDIML_OPERATOR_NAME
#define WARNX_FUNCTION_NAME
#define C_AND_OPERATOR_NAME
#define GREATER_THAN_OPERATOR_NAME
#define CTANF_OPERATOR_NAME
#define ENDFILE_FUNCTION_NAME
#define DIV_FUNCTION_NAME
#define VSWSCANF_FUNCTION_NAME
#define FREOPEN64_FUNCTION_NAME
#define TOWLOWER_OPERATOR_NAME
#define C_GREATER_OR_EQUAL_OPERATOR_NAME
#define SIGN_OPERATOR_NAME
#define ATANF_OPERATOR_NAME
#define ISWXDIGIT_OPERATOR_NAME
#define DMIN1_OPERATOR_NAME
#define C_LOG10_OPERATOR_NAME
#define FDIMF_OPERATOR_NAME
#define LOGF_OPERATOR_NAME
#define FPUTWS_FUNCTION_NAME
#define ATAN2F_OPERATOR_NAME
#define CACOS_OPERATOR_NAME
include <complex.h>
#define STRSTR_FUNCTION_NAME
#define BITWISE_OR_UPDATE_OPERATOR_NAME
#define ABS_OPERATOR_NAME
#define DECIMAL_TO_QUADRUPLE_OPERATOR_NAME
#define TOWCTRANS_OPERATOR_NAME
#define C_REWIND_FUNCTION_NAME
#define GCC_CIMAG_OPERATOR_NAME
#define LLROUNDF_OPERATOR_NAME
#define NEXTTOWARDF_OPERATOR_NAME
#define DBLE_GENERIC_CONVERSION_NAME
#define WCRTOMB_FUNCTION_NAME
#define SYSTEM_FUNCTION_NAME
#define FEGETROUND_FUNCTION_NAME
#define IO_EFFECTS_PACKAGE_NAME
Implicit variables to handle IO effetcs.
#define SUBSTRING_FUNCTION_NAME
#define MBRLEN_FUNCTION_NAME
#define COSHL_OPERATOR_NAME
#define GETC_FUNCTION_NAME
#define ISOC99_FSCANF_FUNCTION_NAME
#define DACOS_OPERATOR_NAME
#define ISHFT_OPERATOR_NAME
Bit manipulation functions.
#define TOASCII_OPERATOR_NAME
#define MALLOC_FUNCTION_NAME
#define ASSERT_FUNCTION_NAME
Here are C intrinsics arranged in the order of the standard ISO/IEC 9899:TC2.
#define LLROUND_OPERATOR_NAME
#define DIRECTIO_FUNCTION_NAME
#define PIPS_IO_BARRIER_OPERATOR_NAME
#define CLEARERR_FUNCTION_NAME
#define TIME_FUNCTION_NAME
include<time.h>
#define CSINL_OPERATOR_NAME
#define COSH_OPERATOR_NAME
#define ISUPPER_OPERATOR_NAME
#define ISALNUM_OPERATOR_NAME
include <ctype.h>
#define VERR_FUNCTION_NAME
#define BUFFERIN_FUNCTION_NAME
#define EOLE_FMA_OPERATOR_NAME
These operators are used within the optimize transformation in order to manipulate operators such as ...
#define WMEMCHR_FUNCTION_NAME
#define WCSTOULL_FUNCTION_NAME
#define IEOR_OPERATOR_NAME
#define LRAND48_FUNCTION_NAME
#define LLRINT_OPERATOR_NAME
#define ACOSHL_OPERATOR_NAME
#define ISPUNCT_OPERATOR_NAME
#define STRERROR_R_FUNCTION_NAME
#define NEXTTOWARDL_OPERATOR_NAME
#define ERR_FUNCTION_NAME
F2008.
#define C_GREATER_THAN_OPERATOR_NAME
#define CPOW_OPERATOR_NAME
#define DSQRT_OPERATOR_NAME
#define MPI_IBSEND_FUNCTION_NAME
#define C_CCOS_OPERATOR_NAME
#define SSCANF_FUNCTION_NAME
#define SINF_OPERATOR_NAME
#define C_MODULO_OPERATOR_NAME
#define MPI_RSEND_FUNCTION_NAME
#define ISDIGIT_OPERATOR_NAME
#define A614_FUNCTION_NAME
#define COPYSIGNL_OPERATOR_NAME
#define CACOSHL_OPERATOR_NAME
#define STRCPY_FUNCTION_NAME
#define MINUS_OPERATOR_NAME
#define IDIM_OPERATOR_NAME
#define CSINHF_OPERATOR_NAME
#define INITSTATE_FUNCTION_NAME
#define C_COSH_OPERATOR_NAME
#define DUP2_FUNCTION_NAME
#define GETWC_FUNCTION_NAME
#define _TOUPPER_OPERATOR_NAME
#define EXP2L_OPERATOR_NAME
#define LGAMMAF_OPERATOR_NAME
#define ATOF_FUNCTION_NAME
random functions of <stdlib.h>
#define ETIME_FUNCTION_NAME
#define ILOGBF_OPERATOR_NAME
#define IO_EFFECTS_UNIT_SPECIFIER_LENGTH
size of the unit specifier
#define AINT_CONVERSION_NAME
#define STRTOUL_FUNCTION_NAME
#define LESS_THAN_OPERATOR_NAME
#define DCMPLX_GENERIC_CONVERSION_NAME
#define DNINT_CONVERSION_NAME
#define PUTC_FUNCTION_NAME
#define ISFINITE_OPERATOR_NAME
#define ENTITY_IMPLIED_DCMPLX_P(e)
#define CCOSH_OPERATOR_NAME
#define CLOG_OPERATOR_NAME
#define ENTITY_UNARY_MINUS_P(e)
#define VSSCANF_FUNCTION_NAME
#define DINT_CONVERSION_NAME
#define MKTEMP_FUNCTION_NAME
#define IABS_OPERATOR_NAME
#define FLOORF_OPERATOR_NAME
#define ERRX_FUNCTION_NAME
#define EQUIV_OPERATOR_NAME
#define STRTOL_FUNCTION_NAME
#define WCSTOLL_FUNCTION_NAME
#define CLOGF_OPERATOR_NAME
#define NRAND48_FUNCTION_NAME
#define SCALBLNL_OPERATOR_NAME
#define CTAN_OPERATOR_NAME
#define ASM_FUNCTION_NAME
__asm function
#define Y0_OPERATOR_NAME
#define DIVIDE_UPDATE_OPERATOR_NAME
#define WSCANF_FUNCTION_NAME
#define RAISE_FUNCTION_NAME
#define CEILF_OPERATOR_NAME
#define FSEEK_FUNCTION_NAME
#define ISGREATER_OPERATOR_NAME
#define C_SQRT_OPERATOR_NAME
#define MPI_IRSEND_FUNCTION_NAME
#define USLEEP_FUNCTION_NAME
#define STRCHR_FUNCTION_NAME
#define MODF_OPERATOR_NAME
#define GETOPT_FUNCTION_NAME
#define CBRT_OPERATOR_NAME
#define C_164A_FUNCTION_NAME
#define ATOLL_FUNCTION_NAME
#define ISATTY_FUNCTION_NAME
#define FGETWS_FUNCTION_NAME
#define COMMA_OPERATOR_NAME
#define MODULO_UPDATE_OPERATOR_NAME
#define POINT_TO_OPERATOR_NAME
Definition: ri-util-local.h:92
#define CSQRTF_OPERATOR_NAME
#define _IO_GETC_FUNCTION_NAME
#define ISWLOWER_OPERATOR_NAME
#define PUTCHAR_FUNCTION_NAME
#define PLUS_OPERATOR_NAME
#define LOG10_OPERATOR_NAME
#define VPRINTF_FUNCTION_NAME
#define LENGTH_OPERATOR_NAME
#define CATAN_OPERATOR_NAME
#define TIME_EFFECTS_BUFFER_NAME
#define LOG2F_OPERATOR_NAME
#define SWAB_FUNCTION_NAME
#define SIGNAL_OPERATOR_NAME
signal.h
#define STRTOK_FUNCTION_NAME
#define GCC_CREAL_OPERATOR_NAME
#define DCOSH_OPERATOR_NAME
#define DIM_OPERATOR_NAME
#define LOCALTIME_FUNCTION_NAME
#define IOCTL_FUNCTION_NAME
#define EXPF_OPERATOR_NAME
#define WCSCAT_FUNCTION_NAME
#define LRINTF_OPERATOR_NAME
#define LLRINTL_OPERATOR_NAME
#define _EXIT_FUNCTION_NAME
#define SPRINTF_FUNCTION_NAME
#define TANL_OPERATOR_NAME
#define DIMAG_CONVERSION_NAME
#define MVBITS_OPERATOR_NAME
#define FMAL_OPERATOR_NAME
#define LDEXP_OPERATOR_NAME
#define SIN_OPERATOR_NAME
#define RAND_FUNCTION_NAME
#define SINGLE_TO_DECIMAL_OPERATOR_NAME
#define RANDOM_FUNCTION_NAME
#define C_COS_OPERATOR_NAME
#define FMAX_OPERATOR_NAME
#define TMPFILE64_FUNCTION_NAME
#define EXPL_OPERATOR_NAME
#define NEARBYINTL_OPERATOR_NAME
#define EQUAL_OPERATOR_NAME
#define CEXPF_OPERATOR_NAME
#define FTELLO_FUNCTION_NAME
#define WMEMMOVE_FUNCTION_NAME
#define STRRCHR_FUNCTION_NAME
#define FPUTWC_FUNCTION_NAME
#define STRNCAT_FUNCTION_NAME
#define QGCONVERT_OPERATOR_NAME
#define QGCVT_FUNCTION_NAME
#define FETESTEXCEPT_FUNCTION_NAME
#define FMODL_OPERATOR_NAME
#define REMAINDER_OPERATOR_NAME
#define WARN_FUNCTION_NAME
#define DEFAULT_INTEGER_TYPE_SIZE
#define MEMCMP_FUNCTION_NAME
#define WCSCSPN_FUNCTION_NAME
#define FMIN_OPERATOR_NAME
#define C_CSQRT_OPERATOR_NAME
#define ISWUPPER_OPERATOR_NAME
#define LROUNDL_OPERATOR_NAME
#define IO_EFFECTS_ARRAY_NAME
array of Logical UNits; it is more or less handled as the current file pointer; in C,...
#define MBSRTOWCS_FUNCTION_NAME
#define ATANHL_OPERATOR_NAME
#define FDOPEN_FUNCTION_NAME
#define EXPM1_OPERATOR_NAME
#define CREALL_OPERATOR_NAME
#define WCSCPY_FUNCTION_NAME
#define WCSTOF_FUNCTION_NAME
#define CPROJL_OPERATOR_NAME
#define CLOGL_OPERATOR_NAME
#define IBITS_OPERATOR_NAME
#define DLOG10_OPERATOR_NAME
#define DCONJG_OPERATOR_NAME
#define FREOPEN_FUNCTION_NAME
#define CCOSHF_OPERATOR_NAME
#define QSORT_FUNCTION_NAME
#define CALLOC_FUNCTION_NAME
#define ILOGBL_OPERATOR_NAME
#define CSINHL_OPERATOR_NAME
#define MAX0_OPERATOR_NAME
#define J1_OPERATOR_NAME
#define make_entity(n, t, s, i)
#define AMIN0_OPERATOR_NAME
#define SETLOCALE_FUNCTION_NAME
include <locale.h>
#define PSELECT_FUNCTION_NAME
#define GETPW_FUNCTION_NAME
#define ECONVERT_OPERATOR_NAME
#define CLOCK_FUNCTION_NAME
time.h
#define POWF_OPERATOR_NAME
#define SCALBLN_OPERATOR_NAME
#define FOPEN_FUNCTION_NAME
#define RETURN_FUNCTION_NAME
#define C_ASINH_OPERATOR_NAME
#define MEMMOVE_EFFECTS_PACKAGE_NAME
package name for memmove routines
#define BACKSPACE_FUNCTION_NAME
#define ISOC99_VSSCANF_FUNCTION_NAME
#define CARGL_OPERATOR_NAME
#define DEREFERENCING_OPERATOR_NAME
Definition: ri-util-local.h:93
#define CEILL_OPERATOR_NAME
#define CASE_FUNCTION_NAME
#define MIN0_OPERATOR_NAME
#define LRINT_OPERATOR_NAME
#define CSINF_OPERATOR_NAME
#define VFWPRINTF_FUNCTION_NAME
#define PIPS_C_MAX_OPERATOR_NAME
#define JRAND48_FUNCTION_NAME
#define GETCHAR_FUNCTION_NAME
#define C_CABS_OPERATOR_NAME
#define __ERRNO_LOCATION_OPERATOR_NAME
bits/errno.h
#define UNLINK_FUNCTION_NAME
#define ASINL_OPERATOR_NAME
#define CREAT_FUNCTION_NAME
#define HYPOTL_OPERATOR_NAME
#define LOG2L_OPERATOR_NAME
#define STRCSPN_FUNCTION_NAME
#define MAX1_OPERATOR_NAME
#define WPRINTF_FUNCTION_NAME
#define FIELD_OPERATOR_NAME
Definition: ri-util-local.h:91
#define SFCONVERT_OPERATOR_NAME
#define ROUNDF_OPERATOR_NAME
#define HYPOT_OPERATOR_NAME
#define WMEMCMP_FUNCTION_NAME
#define CARGF_OPERATOR_NAME
#define NON_EQUIV_OPERATOR_NAME
#define CEIL_OPERATOR_NAME
#define C_CLOG_OPERATOR_NAME
#define LGAMMAL_OPERATOR_NAME
#define ISOC99_SSCANF_FUNCTION_NAME
#define WCTRANS_OPERATOR_NAME
#define MATHERR_OPERATOR_NAME
#define CASINH_OPERATOR_NAME
#define FABSL_OPERATOR_NAME
#define C_NON_EQUAL_OPERATOR_NAME
#define ISWPRINT_OPERATOR_NAME
#define MODFF_OPERATOR_NAME
#define LEFT_SHIFT_UPDATE_OPERATOR_NAME
#define LDEXPF_OPERATOR_NAME
#define SCALB_OPERATOR_NAME
#define ATOQ_FUNCTION_NAME
#define BTOWC_FUNCTION_NAME
#define OPEN64_FUNCTION_NAME
#define IMS_OPERATOR_NAME
#define WCTOB_FUNCTION_NAME
#define FMINL_OPERATOR_NAME
#define STRTOLD_FUNCTION_NAME
#define MEMCPY_FUNCTION_NAME
include <string.h>
#define DECIMAL_TO_DOUBLE_OPERATOR_NAME
#define REAL_MODULO_OPERATOR_NAME
#define SETVBUF_FUNCTION_NAME
#define ISBLANK_OPERATOR_NAME
#define QFCVT_FUNCTION_NAME
#define STRXFRM_FUNCTION_NAME
#define DATA_LIST_FUNCTION_NAME
Definition: ri-util-local.h:81
#define LLABS_FUNCTION_NAME
#define CCOSHL_OPERATOR_NAME
#define ILOGB_OPERATOR_NAME
#define GETW_FUNCTION_NAME
#define LOG10L_OPERATOR_NAME
#define NEARBYINT_OPERATOR_NAME
#define CONJG_OPERATOR_NAME
#define ASINHL_OPERATOR_NAME
#define ISOC99_SCANF_FUNCTION_NAME
#define C_TAN_OPERATOR_NAME
#define GCVT_FUNCTION_NAME
#define WCSTOUL_FUNCTION_NAME
#define LOGBL_OPERATOR_NAME
#define C_SIN_OPERATOR_NAME
#define AMAX0_OPERATOR_NAME
#define VFSCANF_FUNCTION_NAME
#define CCOSL_OPERATOR_NAME
#define GETOPT_LONG_ONLY_FUNCTION_NAME
#define FFLUSH_FUNCTION_NAME
#define STRDUP_FUNCTION_NAME
#define ROUNDL_OPERATOR_NAME
#define GETWCHAR_FUNCTION_NAME
#define ISWBLANK_OPERATOR_NAME
#define FMAXF_OPERATOR_NAME
#define REWIND_FUNCTION_NAME
#define LROUND_OPERATOR_NAME
#define LLROUNDL_OPERATOR_NAME
#define DMAX1_OPERATOR_NAME
#define RENAME_FUNCTION_NAME
#define IBSET_OPERATOR_NAME
#define CDSQRT_OPERATOR_NAME
#define FWPRINTF_FUNCTION_NAME
include <wchar.h>
#define IFIX_GENERIC_CONVERSION_NAME
#define FREE_FUNCTION_NAME
#define ACOS_OPERATOR_NAME
#define EXPM1F_OPERATOR_NAME
#define FPRINTF_FUNCTION_NAME
#define WCSNCPY_FUNCTION_NAME
#define MULTIPLY_UPDATE_OPERATOR_NAME
#define GETSUBOPT_FUNCTION_NAME
#define Y1_OPERATOR_NAME
#define ACOSL_OPERATOR_NAME
#define C_READ_FUNCTION_NAME
#define GETTIMEOFDAY_FUNCTION_NAME
#define C_ACOS_OPERATOR_NAME
#define OPEN_FUNCTION_NAME
#define END_FUNCTION_NAME
#define CCOSF_OPERATOR_NAME
#define ISWPUNCT_OPERATOR_NAME
#define BSEARCH_FUNCTION_NAME
#define WMEMSET_FUNCTION_NAME
#define MALLOC_EFFECTS_NAME
variable name for heap effects
#define ISHFTC_OPERATOR_NAME
#define TMPFILE_FUNCTION_NAME
#define C_ABS_FUNCTION_NAME
#define ISNAN_OPERATOR_NAME
#define MPI_SEND_FUNCTION_NAME
#define FCVT_FUNCTION_NAME
#define IMPLIED_DO_NAME
Definition: ri-util-local.h:75
#define GETOPT_LONG_FUNCTION_NAME
#define ABORT_FUNCTION_NAME
#define CREAL_OPERATOR_NAME
#define CDCOS_OPERATOR_NAME
#define INVERSE_OPERATOR_NAME
#define ERFF_OPERATOR_NAME
#define LEFT_SHIFT_OPERATOR_NAME
#define CDLOG_OPERATOR_NAME
#define ISXDIGIT_OPERATOR_NAME
#define CONDITIONAL_OPERATOR_NAME
#define BREAK_FUNCTION_NAME
#define CPOWF_OPERATOR_NAME
#define SCALBLNF_OPERATOR_NAME
#define TTYSLOT_FUNCTION_NAME
#define VFWSCANF_FUNCTION_NAME
#define ALOG10_OPERATOR_NAME
#define FMODF_OPERATOR_NAME
#define EXTENDED_TO_DECIMAL_OPERATOR_NAME
#define MPI_ISEND_FUNCTION_NAME
#define LLT_OPERATOR_NAME
#define VSPRINTF_FUNCTION_NAME
#define SETBUFFER_FUNCTION_NAME
#define C_ASIN_OPERATOR_NAME
#define CLOCK_GETTIME_FUNCTION_NAME
#define C_RETURN_FUNCTION_NAME
#define FSEEKO_FUNCTION_NAME
#define YN_OPERATOR_NAME
#define GETPASS_FUNCTION_NAME
#define BUFFEROUT_FUNCTION_NAME
#define GRANTPT_FUNCTION_NAME
#define WCSNCAT_FUNCTION_NAME
#define CCOS_OPERATOR_NAME
#define ROUND_OPERATOR_NAME
#define C_LOC_FUNCTION_NAME
F2003.
#define ISGRAPH_OPERATOR_NAME
#define MPI_INIT_FUNCTION_NAME
PI calls.
#define LCONG48_FUNCTION_NAME
#define DPROD_OPERATOR_NAME
#define GETENV_FUNCTION_NAME
#define CUSERID_FUNCTION_NAME
#define CDSIN_OPERATOR_NAME
#define SCALBNF_OPERATOR_NAME
#define LLRINTF_OPERATOR_NAME
#define SINHL_OPERATOR_NAME
#define AND_OPERATOR_NAME
FI: intrinsics are defined at a third place after bootstrap and effects! I guess the name should be d...
#define ISNORMAL_OPERATOR_NAME
#define MINUS_UPDATE_OPERATOR_NAME
#define MPI_RECV_FUNCTION_NAME
#define ANINT_CONVERSION_NAME
#define REMOVE_FUNCTION_NAME
#define CPROJF_OPERATOR_NAME
#define TRUNCL_OPERATOR_NAME
#define UNGETWC_FUNCTION_NAME
#define SIGNBIT_OPERATOR_NAME
#define EOLE_FMS_OPERATOR_NAME
#define C_NOT_OPERATOR_NAME
#define MKSTEMP64_FUNCTION_NAME
#define CATANHL_OPERATOR_NAME
#define CABSL_OPERATOR_NAME
#define INT_TO_CHAR_CONVERSION_NAME
#define ISWALPHA_OPERATOR_NAME
#define FOPEN64_FUNCTION_NAME
#define ASSERT_FAIL_FUNCTION_NAME
#define OMP_FOR_FUNCTION_NAME
#define GCONVERT_OPERATOR_NAME
#define VWSCANF_FUNCTION_NAME
#define POW_OPERATOR_NAME
#define LGAMMA_OPERATOR_NAME
#define CONTINUE_FUNCTION_NAME
#define ACOSF_OPERATOR_NAME
#define FMAF_OPERATOR_NAME
#define ALLOCATE_FUNCTION_NAME
F95.
#define ISLESS_OPERATOR_NAME
#define FSTAT_FUNCTION_NAME
#define WCSTOD_FUNCTION_NAME
#define __FILSBUF_FUNCTION_NAME
#define STRTOD_FUNCTION_NAME
#define WCSXFRM_FUNCTION_NAME
#define RINT_OPERATOR_NAME
#define LINK_FUNCTION_NAME
#define ISOC99_VSCANF_FUNCTION_NAME
#define POSIX_MEMALIGN_FUNCTION_NAME
#define SNPRINTF_FUNCTION_NAME
#define WCSCMP_FUNCTION_NAME
#define COPYSIGN_OPERATOR_NAME
#define CSINH_OPERATOR_NAME
#define NEXTAFTERL_OPERATOR_NAME
#define COSHF_OPERATOR_NAME
#define VWPRINTF_FUNCTION_NAME
#define COSL_OPERATOR_NAME
#define MEMMOVE_EFFECTS_NAME
variable name for memmove unit
#define ADDRESS_OF_OPERATOR_NAME
#define CMPLX_GENERIC_CONVERSION_NAME
#define FABSF_OPERATOR_NAME
#define IO_EOF_ARRAY_NAME
array of end of file codes
#define DOUBLE_TO_DECIMAL_OPERATOR_NAME
#define PIPS_MEMORY_BARRIER_OPERATOR_NAME
special pips intrinsics with global effects
#define ATOL_FUNCTION_NAME
#define C_ATAN2_OPERATOR_NAME
#define MBRTOWC_FUNCTION_NAME
#define IO_EFFECTS_IO_FILE_NAME
Array of struct io_files pointed to by pointers returned by fopen and used by fclose,...
#define PRE_DECREMENT_OPERATOR_NAME
#define MKSTEMP_FUNCTION_NAME
#define CHAR_TO_INT_CONVERSION_NAME
#define FCNTL_FUNCTION_NAME
include <fcntl.h>
#define SQRT_OPERATOR_NAME
#define MPI_COMM_RANK_FUNCTION_NAME
#define ATAN_OPERATOR_NAME
#define ATANHF_OPERATOR_NAME
#define PUTWCHAR_FUNCTION_NAME
#define ERFL_OPERATOR_NAME
#define ISIGN_OPERATOR_NAME
#define C_CEXP_OPERATOR_NAME
#define STRTOULL_FUNCTION_NAME
#define TGAMMA_OPERATOR_NAME
#define OMP_OMP_FUNCTION_NAME
#define UNGETC_FUNCTION_NAME
#define STRPBRK_FUNCTION_NAME
#define SRAND48_FUNCTION_NAME
#define GETCWD_FUNCTION_NAME
#define OMP_PARALLEL_FUNCTION_NAME
#define QUADRUPLE_TO_DECIMAL_OPERATOR_NAME
#define INT_GENERIC_CONVERSION_NAME
generic conversion names.
#define C_ATAN_OPERATOR_NAME
#define MPI_COMM_SIZE_FUNCTION_NAME
#define EXP2F_OPERATOR_NAME
#define SELECT_FUNCTION_NAME
#define MALLOC_EFFECTS_PACKAGE_NAME
package name for malloc routines (could be libc package)
#define C_CLOSE_FUNCTION_NAME
#define GETEXECNAME_FUNCTION_NAME
#define GAMMA_OPERATOR_NAME
#define LGE_OPERATOR_NAME
#define IMPLIED_DCOMPLEX_NAME
Definition: ri-util-local.h:89
#define SWSCANF_FUNCTION_NAME
#define NANOSLEEP_FUNCTION_NAME
#define DIVIDE_OPERATOR_NAME
#define MEMCHR_FUNCTION_NAME
#define DRAND48_FUNCTION_NAME
#define BIT_SIZE_OPERATOR_NAME
#define TGAMMAF_OPERATOR_NAME
#define WRITE_FUNCTION_NAME
#define SETLINEBUF_FUNCTION_NAME
#define NAN_OPERATOR_NAME
#define DABS_OPERATOR_NAME
#define REMAINDERL_OPERATOR_NAME
#define SINL_OPERATOR_NAME
#define FECLEAREXCEPT_FUNCTION_NAME
include <fenv.h>
#define DIFFTIME_FUNCTION_NAME
#define CBRTL_OPERATOR_NAME
#define SETKEY_FUNCTION_NAME
#define JN_OPERATOR_NAME
#define CLOSE_FUNCTION_NAME
#define FABS_OPERATOR_NAME
#define GETPASSPHRASE_FUNCTION_NAME
#define STRCOLL_FUNCTION_NAME
#define UNARY_MINUS_OPERATOR_NAME
#define MPI_BSEND_FUNCTION_NAME
#define SEND_FUNCTION_NAME
SPIRE API.
#define AMIN1_OPERATOR_NAME
#define LROUNDF_OPERATOR_NAME
#define _IO_PUTC_FUNCTION_NAME
#define MPI_IRECV_FUNCTION_NAME
#define DCOS_OPERATOR_NAME
#define RINTF_OPERATOR_NAME
#define BITWISE_XOR_UPDATE_OPERATOR_NAME
#define FERAISEEXCEPT_FUNCTION_NAME
#define CASINHL_OPERATOR_NAME
#define C_OPEN_FUNCTION_NAME
Not found in unistd.h.
#define MPI_SSEND_FUNCTION_NAME
#define LRINTL_OPERATOR_NAME
#define ISNANL_OPERATOR_NAME
#define QFCONVERT_OPERATOR_NAME
#define STRCAT_FUNCTION_NAME
#define ISGREATEREQUAL_OPERATOR_NAME
#define CATANHF_OPERATOR_NAME
#define TEMPNAM_FUNCTION_NAME
#define CARG_OPERATOR_NAME
#define LLTOSTR_FUNCTION_NAME
#define CONCATENATION_FUNCTION_NAME
#define WCSTOLD_FUNCTION_NAME
#define EXP_OPERATOR_NAME
#define STATIC_INITIALIZATION_FUNCTION_NAME
Definition: ri-util-local.h:80
#define ERAND48_FUNCTION_NAME
#define FMA_OPERATOR_NAME
#define WCSPBRK_FUNCTION_NAME
#define EOLE_PROD_OPERATOR_NAME
#define VSCANF_FUNCTION_NAME
#define HYPOTF_OPERATOR_NAME
#define WMEMCPY_FUNCTION_NAME
#define IBCLR_OPERATOR_NAME
#define WCSCOLL_FUNCTION_NAME
#define CTANH_OPERATOR_NAME
#define PCLOSE_FUNCTION_NAME
#define SRANDOM_FUNCTION_NAME
#define PIPS_C_MIN_OPERATOR_NAME
PIPS run-time support for C code generation.
#define LDIV_FUNCTION_NAME
#define FSEEKO64_FUNCTION_NAME
#define ATAN2L_OPERATOR_NAME
#define C_LOG_OPERATOR_NAME
#define basic_compatible_p(b1, b2)
#define LOGBF_OPERATOR_NAME
#define IMA_OPERATOR_NAME
Integer Multiply Add and Sub, FC 27/10/2005 for FI.
#define ERF_OPERATOR_NAME
#define UNARY_PLUS_OPERATOR_NAME
#define ASINHF_OPERATOR_NAME
#define BRACE_INTRINSIC
Definition: ri-util-local.h:85
#define NANF_OPERATOR_NAME
#define LOG_OPERATOR_NAME
#define FDIM_OPERATOR_NAME
#define RIGHT_SHIFT_UPDATE_OPERATOR_NAME
#define POPEN_FUNCTION_NAME
#define ATEXIT_FUNCTION_NAME
#define LOGL_OPERATOR_NAME
#define SECOND_FUNCTION_NAME
#define DSIN_OPERATOR_NAME
#define NEXTAFTER_OPERATOR_NAME
#define RINTL_OPERATOR_NAME
#define FGETS_FUNCTION_NAME
#define ISSPACE_OPERATOR_NAME
#define FEOF_FUNCTION_NAME
#define ISLESSGREATER_OPERATOR_NAME
#define FESETROUND_FUNCTION_NAME
#define VERRX_FUNCTION_NAME
#define C_ATANH_OPERATOR_NAME
#define CSQRT_OPERATOR_NAME
#define ISASCII_OPERATOR_NAME
#define IOR_OPERATOR_NAME
#define C_SINH_OPERATOR_NAME
#define CSQRTL_OPERATOR_NAME
#define ASINF_OPERATOR_NAME
#define C_LESS_THAN_OPERATOR_NAME
#define ACOSHF_OPERATOR_NAME
#define BITWISE_NOT_OPERATOR_NAME
#define __H_ERRNO_LOCATION_OPERATOR_NAME
netdb.h
#define CATANL_OPERATOR_NAME
#define IO_ERROR_ARRAY_NAME
array of error codes for LUNs
#define CACOSHF_OPERATOR_NAME
#define FLOORL_OPERATOR_NAME
#define GREATER_OR_EQUAL_OPERATOR_NAME
#define TAN_OPERATOR_NAME
#define FILE_TO_DECIMAL_OPERATOR_NAME
#define PUTW_FUNCTION_NAME
#define VWARNX_FUNCTION_NAME
#define ERFCF_OPERATOR_NAME
#define FILENO_FUNCTION_NAME
#define STOP_FUNCTION_NAME
#define DECIMAL_TO_EXTENDED_OPERATOR_NAME
#define PRE_INCREMENT_OPERATOR_NAME
Definition: ri-util-local.h:99
#define WCSTOL_FUNCTION_NAME
#define VWARN_FUNCTION_NAME
#define STRING_TO_DECIMAL_OPERATOR_NAME
#define FTELL_FUNCTION_NAME
#define CACOSL_OPERATOR_NAME
#define CIMAG_OPERATOR_NAME
#define EOLE_SUM_OPERATOR_NAME
#define REALPATH_FUNCTION_NAME
#define FPUTC_FUNCTION_NAME
#define CEXPL_OPERATOR_NAME
#define EXITHANDLE_FUNCTION_NAME
#define SETBUF_FUNCTION_NAME
#define C_CSIN_OPERATOR_NAME
#define POST_INCREMENT_OPERATOR_NAME
Definition: ri-util-local.h:97
#define TMPNAM_FUNCTION_NAME
#define DSINH_OPERATOR_NAME
#define ENTITY_IMPLIED_CMPLX_P(e)
#define SIGFPE_OPERATOR_NAME
#define IAND_OPERATOR_NAME
#define QECVT_FUNCTION_NAME
#define ISWCNTRL_OPERATOR_NAME
#define AIMAG_CONVERSION_NAME
#define EXIT_FUNCTION_NAME
#define PLUS_UPDATE_OPERATOR_NAME
#define WCSSTR_FUNCTION_NAME
#define WCSTOK_FUNCTION_NAME
#define CONJ_OPERATOR_NAME
#define SIGNIFICAND_OPERATOR_NAME
#define J0_OPERATOR_NAME
#define LSTAT_FUNCTION_NAME
#define MPI_ISSEND_FUNCTION_NAME
#define PTSNAME_FUNCTION_NAME
#define INDEX_OPERATOR_NAME
#define ISLESSEQUAL_OPERATOR_NAME
#define ISWGRAPH_OPERATOR_NAME
#define ISNANF_OPERATOR_NAME
#define BTEST_OPERATOR_NAME
#define WCTYPE_OPERATOR_NAME
#define TRUNCF_OPERATOR_NAME
#define MBLEN_FUNCTION_NAME
#define ISWDIGIT_OPERATOR_NAME
#define PAUSE_FUNCTION_NAME
#define CDEXP_OPERATOR_NAME
#define STRTOF_FUNCTION_NAME
#define FLOOR_OPERATOR_NAME
#define SINHF_OPERATOR_NAME
#define STRTOLL_FUNCTION_NAME
#define COSF_OPERATOR_NAME
#define LOG10F_OPERATOR_NAME
#define VSNPRINTF_FUNCTION_NAME
#define FORMAT_FUNCTION_NAME
#define LLDIV_FUNCTION_NAME
#define DATAN2_OPERATOR_NAME
#define WCSLEN_FUNCTION_NAME
#define DDIM_OPERATOR_NAME
#define TANHF_OPERATOR_NAME
#define FGETPOS64_FUNCTION_NAME
#define SINH_OPERATOR_NAME
#define OMP_IF_FUNCTION_NAME
OMP related function and opertor names.
#define FPCLASSIFY_OPERATOR_NAME
include <math.h>
#define PERROR_FUNCTION_NAME
#define REAL_GENERIC_CONVERSION_NAME
#define DEFAULT_FUNCTION_NAME
#define WCTOMB_FUNCTION_NAME
#define CACOSF_OPERATOR_NAME
#define TRUNC_OPERATOR_NAME
#define CTERMID_FUNCTION_NAME
#define SQRTF_OPERATOR_NAME
#define ISINF_OPERATOR_NAME
#define STRNCMP_FUNCTION_NAME
#define ISUNORDERED_OPERATOR_NAME
#define TOUPPER_OPERATOR_NAME
#define MINUS_C_OPERATOR_NAME
#define MULTIPLY_OPERATOR_NAME
#define DEXP_OPERATOR_NAME
#define BITWISE_AND_UPDATE_OPERATOR_NAME
#define DLOG_OPERATOR_NAME
#define LESS_OR_EQUAL_OPERATOR_NAME
#define CBRTF_OPERATOR_NAME
#define C_OR_OPERATOR_NAME
#define STRERROR_FUNCTION_NAME
#define CONJL_OPERATOR_NAME
#define BITWISE_AND_OPERATOR_NAME
#define CSIN_OPERATOR_NAME
#define SNGL_GENERIC_CONVERSION_NAME
#define FMOD_OPERATOR_NAME
#define IMAXABS_FUNCTION_NAME
include <inttypes.h>
#define SCALBNL_OPERATOR_NAME
#define DTANH_OPERATOR_NAME
#define EXP2_OPERATOR_NAME
#define TIME_EFFECTS_VARIABLE_NAME
variable holding time effects
#define entity_constant_p(e)
#define UNLOCKPT_FUNCTION_NAME
#define DFLOAT_GENERIC_CONVERSION_NAME
#define SQRTL_OPERATOR_NAME
#define FERROR_FUNCTION_NAME
#define TANHL_OPERATOR_NAME
#define FWIDE_FUNCTION_NAME
#define WCSNCMP_FUNCTION_NAME
#define SYMLINK_FUNCTION_NAME
#define ULLTOSTR_FUNCTION_NAME
#define OMP_REDUCTION_FUNCTION_NAME
#define RIGHT_SHIFT_OPERATOR_NAME
#define CATANF_OPERATOR_NAME
#define CATANH_OPERATOR_NAME
#define ISCNTRL_OPERATOR_NAME
#define ASIN_OPERATOR_NAME
#define AMAX1_OPERATOR_NAME
#define CTANL_OPERATOR_NAME
#define CABSF_OPERATOR_NAME
#define CASINHF_OPERATOR_NAME
#define CONJF_OPERATOR_NAME
#define PUTENV_FUNCTION_NAME
#define DEALLOCATE_FUNCTION_NAME
#define SECONVERT_OPERATOR_NAME
#define DASIN_OPERATOR_NAME
#define TANF_OPERATOR_NAME
#define INQUIRE_FUNCTION_NAME
#define NEXTTOWARD_OPERATOR_NAME
#define PUTS_FUNCTION_NAME
#define IDINT_GENERIC_CONVERSION_NAME
#define MEMMOVE_FUNCTION_NAME
#define NOT_OPERATOR_NAME
#define POWL_OPERATOR_NAME
#define MPI_FINALIZE_FUNCTION_NAME
#define IMPLIED_COMPLEX_NAME
Definition: ri-util-local.h:88
#define FSCANF_FUNCTION_NAME
#define FCONVERT_OPERATOR_NAME
#define WCSCHR_FUNCTION_NAME
#define LGT_OPERATOR_NAME
#define MIN1_OPERATOR_NAME
#define ISWCTYPE_OPERATOR_NAME
#define CASIN_OPERATOR_NAME
#define LOG1PF_OPERATOR_NAME
#define ASSIGN_SUBSTRING_FUNCTION_NAME
#define OR_OPERATOR_NAME
#define VSWPRINTF_FUNCTION_NAME
#define LOG1PL_OPERATOR_NAME
#define FSETPOS64_FUNCTION_NAME
#define CIMAGL_OPERATOR_NAME
#define NON_EQUAL_OPERATOR_NAME
#define DATAN_OPERATOR_NAME
#define DTAN_OPERATOR_NAME
#define C_EQUAL_OPERATOR_NAME
#define ISWSPACE_OPERATOR_NAME
#define PRINTF_FUNCTION_NAME
include<stdio.h>
#define ECVT_FUNCTION_NAME
#define CIMAGF_OPERATOR_NAME
#define ASSIGN_OPERATOR_NAME
Definition: ri-util-local.h:95
#define ISPRINT_OPERATOR_NAME
#define MODULO_OPERATOR_NAME
#define SCALBN_OPERATOR_NAME
@ ENTITY_STATIC_AREA
@ EFFECTS_PACKAGE
@ ABSTRACT_LOCATION
@ DEFAULT_ENTITY_KIND
@ ENTITY_DYNAMIC_AREA
#define PUTWC_FUNCTION_NAME
#define PIPS_C_DIV_OPERATOR_NAME
#define FPUTS_FUNCTION_NAME
#define PLUS_C_OPERATOR_NAME
#define MPI_BARRIER_FUNCTION_NAME
#define FCLOSE_FUNCTION_NAME
#define OMP_PRIVATE_FUNCTION_NAME
#define ALOG_OPERATOR_NAME
#define FMAXL_OPERATOR_NAME
#define FREXP_OPERATOR_NAME
#define FSETPOS_FUNCTION_NAME
#define MIN_OPERATOR_NAME
#define MPI_SENDRECV_FUNCTION_NAME
#define CTYPE_B_LOC_OPERATOR_NAME
Part of the binary standard.
#define ISALPHA_OPERATOR_NAME
#define LOG2_OPERATOR_NAME
#define MBSTOWCS_FUNCTION_NAME
#define CASINF_OPERATOR_NAME
#define WCSSPN_FUNCTION_NAME
entity FindEntity(const char *package, const char *name)
Retrieve an entity from its package/module name and its local name.
Definition: entity.c:1503
const char * entity_local_name(entity e)
entity_local_name modified so that it does not core when used in vect_fprint, since someone thought t...
Definition: entity.c:453
entity FindOrCreateEntity(const char *package, const char *local_name)
Problem: A functional global entity may be referenced without parenthesis or CALL keyword in a functi...
Definition: entity.c:1586
char * AddPackageToName(string p, string n)
This function concatenate a package name and a local name to produce a global entity name.
Definition: entity.c:2134
bool entity_label_p(entity e)
Definition: entity.c:678
basic entity_basic(entity e)
return the basic associated to entity e if it's a function/variable/constant basic_undefined otherwis...
Definition: entity.c:1380
void add_thread_safe_variable(entity v)
Definition: entity.c:2525
entity CreateIntrinsic(string name)
this function does not create an intrinsic function because they must all be created beforehand by th...
Definition: entity.c:1311
void add_abstract_state_variable(entity v)
Definition: entity.c:2558
bool expression_call_p(expression e)
Definition: expression.c:415
expression int_to_expression(_int i)
transform an int into an expression and generate the corresponding entity if necessary; it is not cle...
Definition: expression.c:1188
bool fortran_language_module_p(entity m)
Definition: module.c:452
parameter MakeDoubleprecisionParameter(void)
Definition: type.c:209
type MakeLongLongIntegerResult(void)
MB.
Definition: type.c:286
type MakeDoublecomplexResult(void)
Definition: type.c:316
type MakeLongIntegerResult(void)
MB.
Definition: type.c:281
type MakeLongDoublecomplexResult(void)
MB.
Definition: type.c:322
parameter MakeLongDoublecomplexParameter(void)
MB.
Definition: type.c:234
type MakeLogicalResult(void)
Definition: type.c:306
parameter MakeDoublecomplexParameter(void)
Definition: type.c:229
type MakeComplexResult(void)
Definition: type.c:311
type type_to_pointer_type(type)
allocate a new type "pt" which includes directly "t".
Definition: type.c:5253
parameter MakePointerParameter(void)
Definition: type.c:173
type MakeVoidPointerResult(void)
Definition: type.c:271
parameter MakeOverloadedParameter(void)
Definition: type.c:167
parameter MakeCharacterParameter(void)
Definition: type.c:239
bool basic_equal_p(basic, basic)
Definition: type.c:927
type MakeCharacterResult(void)
Definition: type.c:328
type MakeTypeArray(basic, cons *)
functions on types
Definition: type.c:162
type type_to_pointed_type(type)
returns t if t is not a pointer type, and the pointed type if t is a pointer type.
Definition: type.c:5265
type MakeIntegerResult(void)
Definition: type.c:276
type MakeRealResult(void)
Definition: type.c:291
type MakeTypeStatement(void)
Definition: type.c:92
type MakeDoubleprecisionResult(void)
Definition: type.c:296
type make_scalar_integer_type(_int)
Definition: type.c:712
parameter MakeIntegerParameter(void)
Definition: type.c:184
type MakeQuadprecisionResult(void)
MB.
Definition: type.c:301
parameter MakeUnsignedIntegerParameter(void)
Definition: type.c:194
parameter MakeRealParameter(void)
Definition: type.c:204
type MakeOverloadedResult(void)
this function creates a default fortran operator result, i.e.
Definition: type.c:261
parameter MakeLongIntegerParameter(void)
Definition: type.c:189
parameter MakeLongLongIntegerParameter(void)
MB.
Definition: type.c:199
parameter MakeQuadprecisionParameter(void)
MB.
Definition: type.c:214
bool is_inferior_basic(basic, basic)
bool is_inferior_basic(basic1, basic2) return true if basic1 is less complex than basic2 ex: int is l...
Definition: type.c:2687
parameter MakeComplexParameter(void)
Definition: type.c:224
#define value_undefined
Definition: ri.h:3016
@ is_basic_string
Definition: ri.h:576
@ is_basic_float
Definition: ri.h:572
@ is_basic_overloaded
Definition: ri.h:574
@ is_basic_int
Definition: ri.h:571
@ is_basic_logical
Definition: ri.h:573
@ is_basic_complex
Definition: ri.h:575
#define normalized_undefined
Definition: ri.h:1745
#define syntax_reference_p(x)
Definition: ri.h:2728
#define functional_result(x)
Definition: ri.h:1444
#define basic_complex_p(x)
Definition: ri.h:626
#define parameter_type(x)
Definition: ri.h:1819
#define basic_int_p(x)
Definition: ri.h:614
#define syntax_reference(x)
Definition: ri.h:2730
#define syntax_tag(x)
Definition: ri.h:2727
#define call_function(x)
Definition: ri.h:709
#define EXPRESSION_(x)
Definition: ri.h:1220
#define QUALIFIER(x)
QUALIFIER.
Definition: ri.h:2106
#define reference_variable(x)
Definition: ri.h:2326
#define basic_int(x)
Definition: ri.h:616
#define range_upper(x)
Definition: ri.h:2290
#define syntax_call_p(x)
Definition: ri.h:2734
#define type_functional(x)
Definition: ri.h:2952
@ is_mode_reference
Definition: ri.h:1676
#define basic_tag(x)
Definition: ri.h:613
@ is_constant_litteral
Definition: ri.h:820
#define type_variable(x)
Definition: ri.h:2949
#define entity_storage(x)
Definition: ri.h:2794
@ is_value_intrinsic
Definition: ri.h:3034
@ is_value_unknown
Definition: ri.h:3035
@ is_value_constant
Definition: ri.h:3033
@ is_value_code
Definition: ri.h:3031
#define syntax_range(x)
Definition: ri.h:2733
@ is_syntax_range
Definition: ri.h:2692
@ is_syntax_call
Definition: ri.h:2693
@ is_syntax_reference
Definition: ri.h:2691
#define range_increment(x)
Definition: ri.h:2292
#define basic_overloaded_p(x)
Definition: ri.h:623
#define basic_undefined_p(x)
Definition: ri.h:557
#define EXPRESSION(x)
EXPRESSION.
Definition: ri.h:1217
@ is_storage_rom
Definition: ri.h:2494
@ is_storage_ram
Definition: ri.h:2492
#define type_undefined_p(x)
Definition: ri.h:2884
#define basic_undefined
Definition: ri.h:556
#define entity_undefined_p(x)
Definition: ri.h:2762
#define entity_undefined
Definition: ri.h:2761
#define basic_logical(x)
Definition: ri.h:622
#define expression_normalized(x)
Definition: ri.h:1249
#define functional_parameters(x)
Definition: ri.h:1442
#define code_initializations(x)
Definition: ri.h:788
#define PARAMETER(x)
PARAMETER.
Definition: ri.h:1788
#define syntax_call(x)
Definition: ri.h:2736
#define variable_qualifiers(x)
Definition: ri.h:3124
#define basic_float(x)
Definition: ri.h:619
#define range_lower(x)
Definition: ri.h:2288
#define variable_dimensions(x)
Definition: ri.h:3122
#define type_undefined
Definition: ri.h:2883
#define basic_complex(x)
Definition: ri.h:628
#define call_arguments(x)
Definition: ri.h:711
@ is_type_varargs
Definition: ri.h:2902
@ is_type_void
Definition: ri.h:2904
@ is_type_functional
Definition: ri.h:2901
@ is_type_area
Definition: ri.h:2899
#define syntax_range_p(x)
Definition: ri.h:2731
#define basic_string_p(x)
Definition: ri.h:629
#define entity_type(x)
Definition: ri.h:2792
#define expression_syntax(x)
Definition: ri.h:1247
#define functional_undefined
Definition: ri.h:1418
#define entity_domain
newgen_syntax_domain_defined
Definition: ri.h:410
#define variable_basic(x)
Definition: ri.h:3120
#define basic_logical_p(x)
Definition: ri.h:620
#define basic_float_p(x)
Definition: ri.h:617
#define entity_initial(x)
Definition: ri.h:2796
Value b2
Definition: sc_gram.c:105
Value b1
booleen indiquant quel membre est en cours d'analyse
Definition: sc_gram.c:105
Pvecteur cp
pointeur sur l'egalite ou l'inegalite courante
Definition: sc_read.c:87
char * strdup()
The following data structure describes an intrinsic function: its name and its arity and its type,...
type(* intrinsic_type)(int)
FI: I do not understand why the type is duplicated at the set level.
Definition: set.c:59
The structure used to build lists in NewGen.
Definition: newgen_list.h:41
Definition: delay.c:253
list stats
Definition: delay.c:255
context for type checking.
#define ENTITY_CONVERSION_CMPLX_P(e)
Definition: type_checker.c:63
#define ENTITY_CONVERSION_DCMPLX_P(e)
Definition: type_checker.c:64
#define exp
Avoid some warnings from "gcc -Wshadow".
Definition: vasnprintf.c:207