50 #define ONST(x, y) (y)
101 BOOL pu_has_feedback);
184 dra_global->
Enter (st, dgi);
265 while (iter.
Step (&st, &dgi)) {
288 if (DRA_func_table !=
NULL) {
294 while (iter.
Step(&func_name, &func_desc)) {
310 if (DRA_clone_pool_ptr !=
NULL) {
313 DRA_clone_pool_ptr =
NULL;
316 if (DRA_check_pool_ptr !=
NULL) {
318 DRA_check_pool_ptr =
NULL;
339 BOOL pu_has_feedback)
350 if (clone_requests !=
NULL ||
352 ONST(SYMTAB_mp_needs_lno(Current_Symtab),
369 if (clone_requests !=
NULL) {
382 CXX_DELETE (dra_common_ht, DRA_check_pool_ptr);
402 if (
ONST(SYMTAB_has_altentry(Current_Symtab),
417 if (DRA_name_pool_ptr !=
NULL) {
420 DRA_name_pool_ptr =
NULL;
470 if (DRA_func_table ==
NULL) {
477 return needs_cloning;
502 if (end_tir_names !=
NULL) {
503 *end_tir_names =
'\0';
508 for ( ; *tir_name; *end_of_line =
'\n', tir_name = end_of_line+1) {
512 if ((end_of_line = strchr(tir_name,
'\n')) ==
NULL) {
548 if (tir_list ==
NULL) {
550 DRA_clone_table->
Enter(save_orig_name, tir_list);
557 tir_list->
Append(tir_node);
559 needs_cloning =
TRUE;
565 if (end_tir_names !=
NULL) {
569 return needs_cloning;
602 for ( ; *arg_sig; ) {
609 INT64 num_dims = (
INT64) strtol(arg_sig, ¤t, 10);
611 if (current == arg_sig)
623 if (num_dims < 0 || num_dims >
INT16_MAX)
634 INT64 esize = (
INT64) strtol(arg_sig, ¤t, 10);
636 if (current == arg_sig || esize <= 0 || *current++ !=
DRA_ESIZE_END)
644 for (
INT16 dim = 0; dim < num_dims; dim++) {
663 INT64 chunk = (
INT64) strtol(arg_sig, ¤t, 10);
665 if (current == arg_sig || chunk <= 0)
696 BOOL pu_has_feedback,
702 if (
ONST(SYMTAB_has_altentry(Current_Symtab),
727 if (arg_sig !=
NULL) {
759 (
"The name of a DRA clone does not have DRA_MANGLE_SIG prefix"));
764 (
"The name of a DRA clone does not have DRA_MANGLE_SIG postfix"));
775 for ( arg_pos = 0; *arg_sig; arg_sig++, arg_pos++ ) {
779 if (arg_st ==
NULL) {
785 "cannot be satisfied -- too many arguments passed or types mismatch");
795 INT16 num_dims = (
INT16) strtol (arg_sig, &dim_sig, 10);
806 "cannot be satisfied -- non-reshaped argument passed to reshaped formal parameter");
828 "cannot be satisfied -- reshaped argument passed to a non-array formal parameter");
841 "cannot be satisfied -- reshaped argument and matching formal parameter have different ranks");
848 INT64 elem_size = (
INT64) strtol(dim_sig+1, &dim_sig, 10);
857 "cannot be satisfied -- reshaped argument and matching formal parameter have different element sizes");
873 "cannot be satisfied -- reshaping distributions of arguments and formal parameters do not match");
893 *bufptr++ = *arg_sig++;
904 *bufptr++ = *arg_sig++;
925 "has incomplete argument list");
963 BOOL pu_has_feedback)
998 if (clone_desc ==
NULL) {
1016 DRA_func_table->
Enter(clone_name, clone_desc);
1031 if (pu_has_feedback) {
1032 DevWarn(
"Need to fix up feedback in DRA_Add_Clone\n");
1089 if (pu_has_feedback) {
1137 if (
ONST (SYMTAB_src_lang(Current_Symtab) != SYMTAB_C_LANG &&
1138 SYMTAB_src_lang(Current_Symtab) != SYMTAB_CXX_LANG,
1144 WN *current_wn = preamble_wn;
1146 for (
INT16 arg_pos = 0; *arg_sig; arg_sig++, arg_pos++ ) {
1150 INT16 num_dims = (
INT16) strtol (arg_sig, &arg_sig, 10);
1154 for (
INT16 dim = 0; dim < num_dims; dim++) {
1157 INT64 chunk = (
INT64) strtol (arg_sig, &arg_sig, 10);
1164 "__vla_bound") == 0) {
1166 ST* vlabound_st =
ONST(
WN_st(TY_AR_ubnd_tree(arg_ty, dim)),
1179 saw_preamble =
TRUE;
1181 if (wn == current_wn) saw_current =
TRUE;
1184 WN_st(wn) == vlabound_st) {
1186 if (saw_preamble && saw_current) {
1209 (
"Find_Insertion_Point: No STID vla_bound for %s\n",
1243 for (
INT16 arg_pos = 0; *arg_sig; arg_sig++, arg_pos++ ) {
1247 INT16 num_dims = (
INT16) strtol (arg_sig, &arg_sig, 10);
1251 for (
INT16 dim = 0; dim < num_dims; dim++) {
1262 switch (*arg_sig++) {
1274 INT64 chunk = (
INT64) strtol (arg_sig, &arg_sig, 10);
1296 (
"Unrecognized distribution in the mangled name"));
1360 if (wn ==
NULL)
return;
1409 UINT bufsize = 1024;
1410 char *
buf = (
char *) alloca(bufsize);
1412 char *common_name =
NULL;
1413 INT64 common_offset;
1414 INT64 non_dra_start = 0;
1415 INT64 non_dra_end = 0;
1436 char *dot = strchr(st_name,
'.');
1441 if (common_name ==
NULL ||
1442 strcmp(st_name, common_name) != 0) {
1443 common_name = strcpy((
char *) alloca(strlen(st_name)+1),
1453 if (common_name ==
NULL ||
1454 strncmp(st_name, common_name, dot-st_name) != 0) {
1455 common_name = strncpy((
char *) alloca(dot-st_name+1),
1456 st_name, dot-st_name);
1457 common_name[dot-st_name] =
'\0';
1460 common_offset = strtol(dot+1,
NULL, 10);
1467 if (non_dra_end - non_dra_start > 0) {
1468 bufptr += sprintf(bufptr,
" %lld\n", non_dra_end - non_dra_start);
1470 else if (seen_common) {
1476 INT name_len = strlen(common_name);
1478 if (bufptr - buf + name_len + 21 >= bufsize) {
1480 char *newbuf = (
char *) alloca(bufsize);
1481 buf = strcpy(newbuf, buf);
1482 bufptr = buf + strlen(buf);
1485 (void) strcpy(bufptr, common_name);
1488 non_dra_end = non_dra_start = 0;
1514 if (bufptr - buf + 31 + ndims*69 + 21 >= bufsize) {
1516 char *newbuf = (
char *) alloca(bufsize);
1517 buf = strcpy(newbuf, buf);
1518 bufptr = buf + strlen(buf);
1521 if (non_dra_end - non_dra_start > 0) {
1522 bufptr += sprintf(bufptr,
" %lld", non_dra_end - non_dra_start);
1525 non_dra_end = non_dra_start;
1530 for (
INT16 dim = 0; dim < ndims; ++dim) {
1532 bufptr += sprintf(bufptr,
1555 else if (common_offset +
ST_ofst(st) +
TY_size(ty) > non_dra_end) {
1561 if (bufptr != buf) {
1562 if (non_dra_end - non_dra_start > 0) {
1563 bufptr += sprintf(bufptr,
" %lld\n", non_dra_end - non_dra_start);
1588 UINT bufsize = 1024;
1589 char *
buf = (
char *) alloca(bufsize);
1597 if (done_globals)
return;
1598 done_globals =
TRUE;
1625 INT name_len = strlen(st_name);
1627 if (bufptr - buf + name_len + 21 >= bufsize) {
1629 char *newbuf = (
char *) alloca(bufsize);
1630 buf = strcpy(newbuf, buf);
1631 bufptr = buf + strlen(buf);
1634 strcpy (bufptr, st_name);
1650 if (bufptr - buf + 31 + ndims*69 >= bufsize) {
1652 char *newbuf = (
char *) alloca(bufsize);
1653 buf = strcpy(newbuf, buf);
1654 bufptr = buf + strlen(buf);
1662 for (
INT16 dim = 0; dim < ndims; ++dim) {
1664 bufptr += sprintf(bufptr,
1690 bufptr += sprintf (bufptr,
" %lld",
TY_size(ty));
1714 for (
INT16 dim = 0; dim < num_dims; dim++) {
1716 switch (*arg_sig++) {
1732 INT64 chunk = (
INT64) strtol (arg_sig, &arg_sig, 10);
1749 (
"Uncrecognized distribution in the mangled name"));