pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:670: Inside #if defined(DEBUG_MALLOC)
   case '8':    case '9':    case T_FLOAT:    case T_MIXED:    case T_VOID:    case T_ZERO:    case PIKE_T_UNKNOWN:    case T_INT:    case T_OBJECT:    break; -  case PIKE_T_AUTO: -  break; +        default:    Pike_fatal("mk_type(): Unhandled type-node: %d\n", type);    break;    }   #else /* !DEBUG_MALLOC */    if (type == T_ASSIGN) {    t->flags |= PT_FLAG_ASSIGN_0 << PTR_TO_INT(car);    }   #endif /* DEBUG_MALLOC */
pike.git/src/pike_types.c:773:    (void *)(ptrdiff_t)id, 0);       TYPE_STACK_DEBUG("push_object_type");   }      void debug_push_object_type_backwards(int flag, INT32 id)   {    push_object_type(flag, id);   }    - /* used while compiling to get the actual type of the auto type. */ - void debug_push_auto_typed_type( struct pike_type *aggregate ) - { -  copy_pike_type( *++Pike_compiler->type_stackp, -  mk_type(PIKE_T_AUTO, -  (void *)(ptrdiff_t)aggregate, -  NULL, -  0 ) ); -  - } -  +    void debug_push_scope_type(int level)   {    *Pike_compiler->type_stackp = mk_type(T_SCOPE,    (void *)(ptrdiff_t)level,    *Pike_compiler->type_stackp,    PT_COPY_CDR);       TYPE_STACK_DEBUG("push_scope_type");   }   
pike.git/src/pike_types.c:935:    /* Not a program type, convert it to a type type. */    type = T_TYPE;    }    }    /* FALL_THROUGH */    case T_ARRAY:    case T_MULTISET:    case T_NOT:    case T_TYPE:    case T_STRING: +  case PIKE_T_AUTO:    /* Make a new type of the top type, and put it in car. */    *Pike_compiler->type_stackp = mk_type(type,    *Pike_compiler->type_stackp, NULL,    PT_COPY_CAR);    break;       case T_SCOPE:    case T_ASSIGN:    case T_INT:    case T_OBJECT:
pike.git/src/pike_types.c:956:    case PIKE_T_NAME:    default:    /* Should not occur. */    Pike_fatal("Unsupported argument to push_type(): %d\n", type);    break;       case T_FLOAT:    case T_MIXED:    case T_VOID:    case T_ZERO: -  case PIKE_T_AUTO: +     case PIKE_T_UNKNOWN:    /* Leaf type. */    *(++Pike_compiler->type_stackp) = mk_type(type, NULL, NULL, 0);    break;       case '0':    case '1':    case '2':    case '3':    case '4':
pike.git/src/pike_types.c:1020:    /* Both car & cdr. */    push_finished_type(top->cdr);    push_finished_type(top->car);    break;    case T_ARRAY:    case T_MULTISET:    case T_NOT:    case T_TYPE:    case T_PROGRAM:    case T_STRING: +  case PIKE_T_AUTO:    /* car */    push_finished_type(top->car);    break;    case T_SCOPE:    case T_ASSIGN:    /* cdr */    push_finished_type(top->cdr);    break;    case T_INT:    case T_OBJECT:    case T_FLOAT:    case T_MIXED:    case T_VOID:    case T_ZERO: -  case PIKE_T_AUTO: +     case PIKE_T_UNKNOWN:    case '0':    case '1':    case '2':    case '3':    case '4':    case '5':    case '6':    case '7':    case '8':
pike.git/src/pike_types.c:2247:    fprintf(stderr, ")");    break;    case T_NOT:    fprintf(stderr, "not(");    simple_describe_type(s->car);    fprintf(stderr, ")");    break;    case T_VOID: fprintf(stderr, "void"); break;    case T_ZERO: fprintf(stderr, "zero"); break;    case T_MIXED: fprintf(stderr, "mixed"); break; -  case PIKE_T_AUTO: fprintf(stderr, "auto"); break; +  case PIKE_T_AUTO: +  fprintf(stderr, "auto"); +  if (s->car && (s->car->type != T_ZERO)) { +  fprintf(stderr, "("); +  simple_describe_type(s->car); +  fprintf(stderr, ")"); +  } +  break;    default:    fprintf(stderr, "Unknown type node: %d, %p:%p",    s->type, s->car, s->cdr);   #ifdef DEBUG_MALLOC    debug_malloc_dump_references(s, 0, 2, 0);   #endif    break;    }    if (s->flags) {    fprintf(stderr, "[%06x]", s->flags);
pike.git/src/pike_types.c:2543:    break;       case T_MAPPING:    if(t->car->type != T_MIXED || t->cdr->type != T_MIXED) {    string_builder_sprintf(s, "mapping(%T:%T)", t->car, t->cdr);    } else {    string_builder_strcat(s, "mapping");    }    break;    case PIKE_T_AUTO: -  my_strcat("auto"); +  if (t->car->type != T_ZERO) { +  string_builder_sprintf(s, "auto(%T)", t->car); +  } else { +  string_builder_strcat(s, "auto"); +  }    break;    default:    {    string_builder_sprintf(s, "unknown code(%d)", t->type);    break;    }    }   }      struct pike_string *describe_type(struct pike_type *type)
pike.git/src/pike_types.c:9084: Inside #if defined (PIKE_DEBUG) || defined (DO_PIKE_CLEANUP)
   case PIKE_T_NAME:    debug_gc_check (t->car, " as car in a type");    debug_gc_check (t->cdr, " as cdr in a type");    break;    case T_ARRAY:    case T_MULTISET:    case T_NOT:    case T_TYPE:    case T_PROGRAM:    case T_STRING: +  case PIKE_T_AUTO:    debug_gc_check (t->car, " as car in a type");    break;    case T_SCOPE:    case T_ASSIGN:    debug_gc_check (t->cdr, " as cdr in a type");    break;   #ifdef PIKE_DEBUG    case '0':    case '1':    case '2':