pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:2323:    struct reference *ref =    Pike_compiler->new_program->identifier_references + cur_id;    struct identifier *i;       /* No need to do anything for ourselves. */    if (ref == new_ref) continue;       /* Do not zapp hidden identifiers */    if(ref->id_flags & ID_HIDDEN) continue;    +  if(ref->id_flags & ID_VARIANT) continue; +     /* Do not zapp functions with the wrong name... */    if((i = ID_FROM_PTR(Pike_compiler->new_program, ref))->name != name)    continue;       /* Do not zapp inherited inline ('local') identifiers,    * or inherited externals with new externals,    * since this makes it hard to identify in encode_value().    */    if((ref->id_flags & (ID_INLINE|ID_INHERITED)) == (ID_INLINE|ID_INHERITED)    || (ref->id_flags & new_ref->id_flags & ID_EXTERN)) {
pike.git/src/program.c:2446:    * Consider this a fatal?    */    p->identifiers[i].run_time_type = T_FUNCTION;    }    }       /* Fixup identifier overrides. */    for (i = 0; i < p->num_identifier_references; i++) {    struct reference *ref = p->identifier_references + i;    if (ref->id_flags & ID_HIDDEN) continue; +  if (ref->id_flags & ID_VARIANT) continue;    if (ref->inherit_offset != 0) continue;    override_identifier (ref, ID_FROM_PTR (p, ref)->name);    }       /* Ok, sort for binsearch */    for(e=i=0;i<(int)p->num_identifier_references;i++)    {    struct reference *funp;    struct identifier *fun;    funp=p->identifier_references+i;    if(funp->id_flags & ID_HIDDEN) continue; -  +  if(funp->id_flags & ID_VARIANT) continue;    fun=ID_FROM_PTR(p, funp);    if(funp->id_flags & ID_INHERITED)    {    int found_better=-1;    int funa_is_prototype;       /* NOTE: Mixin is currently not supported for PRIVATE symbols. */    if(funp->id_flags & ID_PRIVATE) continue;    funa_is_prototype = fun->func.offset == -1;   /* if(fun->func.offset == -1) continue; * prototype */       /* check for multiple definitions */    for(t=i+1;t<(int)p->num_identifier_references;t++)    {    struct reference *funpb;    struct identifier *funb;       funpb=p->identifier_references+t;    if (funpb->id_flags & ID_HIDDEN) continue; -  +  if (funpb->id_flags & ID_VARIANT) continue;    funb=ID_FROM_PTR(p,funpb);    /* if(funb->func.offset == -1) continue; * prototype */       if(fun->name==funb->name)    {    if (!(funpb->id_flags & ID_PROTECTED)) {    /* Only regard this symbol as better if it    * will end up in the index further below.    */    found_better=t;
pike.git/src/program.c:2576:    if (id >= 0) {    // LFUNs are used.    p->identifier_references[id].id_flags |= ID_USED;    }    }       /* Complain about unused private symbols. */    for (i = 0; i < p->num_identifier_references; i++) {    struct reference *ref = p->identifier_references + i;    if (ref->id_flags & ID_HIDDEN) continue; +  if (ref->id_flags & ID_VARIANT) continue;    if (ref->inherit_offset != 0) continue;       if ((ref->id_flags & (ID_HIDDEN|ID_PRIVATE|ID_USED)) == ID_PRIVATE) {    yywarning("%S is private but not used anywhere.",    ID_FROM_PTR(p, ref)->name);    }    }       /* Set the PROGRAM_LIVE_OBJ flag by looking for destroy() and    * inherited PROGRAM_LIVE_OBJ flags. This is done at fixation time
pike.git/src/program.c:6302:   #endif /* PIKE_DEBUG */       id = -1;    depth = 0;    last_inh = prog->num_inherits;    i = (int)prog->num_identifier_references;    while(i--)    {    funp = prog->identifier_references + i;    if(funp->id_flags & ID_HIDDEN) continue; +  if(funp->id_flags & ID_VARIANT) continue;    if(funp->id_flags & ID_PROTECTED)    if(!(flags & SEE_PROTECTED))    continue;    fun = ID_FROM_PTR(prog, funp);    /* if(fun->func.offset == -1) continue; * Prototype */    if(!is_same_string(fun->name,name)) continue;    if(funp->id_flags & ID_INHERITED)    {    struct inherit *inh = INHERIT_FROM_PTR(prog, funp);    if ((funp->id_flags & ID_PRIVATE) && !(flags & SEE_PRIVATE)) continue;
pike.git/src/program.c:6565:    */      struct array *program_indices(struct program *p)   {    int e;    int n = 0;    struct array *res;    for (e = p->num_identifier_references; e--; ) {    struct identifier *id;    if (p->identifier_references[e].id_flags & -  (ID_HIDDEN|ID_PROTECTED|ID_PRIVATE)) { +  (ID_HIDDEN|ID_VARIANT|ID_PROTECTED|ID_PRIVATE)) {    continue;    }    id = ID_FROM_INT(p, e);    if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) {    /* FIXME!    */    continue;    } else if (IDENTIFIER_IS_CONSTANT(id->identifier_flags)) {    if (id->func.const_info.offset >= 0) {    struct program *p2 = PROG_FROM_INT(p, e);
pike.git/src/program.c:6604:   }      struct array *program_values(struct program *p)   {    int e;    int n = 0;    struct array *res;    for(e = p->num_identifier_references; e--; ) {    struct identifier *id;    if (p->identifier_references[e].id_flags & -  (ID_HIDDEN|ID_PROTECTED|ID_PRIVATE)) { +  (ID_HIDDEN|ID_VARIANT|ID_PROTECTED|ID_PRIVATE)) {    continue;    }    id = ID_FROM_INT(p, e);    if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) {    /* FIXME!    */    continue;    } else if (IDENTIFIER_IS_CONSTANT(id->identifier_flags)) {    if (id->func.const_info.offset >= 0) {    struct program *p2 = PROG_FROM_INT(p, e);
pike.git/src/program.c:6643:   }      struct array *program_types(struct program *p)   {    int e;    int n = 0;    struct array *res;    for (e = p->num_identifier_references; e--; ) {    struct identifier *id;    if (p->identifier_references[e].id_flags & -  (ID_HIDDEN|ID_PROTECTED|ID_PRIVATE)) { +  (ID_HIDDEN|ID_VARIANT|ID_PROTECTED|ID_PRIVATE)) {    continue;    }    id = ID_FROM_INT(p, e);    if (IDENTIFIER_IS_ALIAS(id->identifier_flags)) {    /* FIXME!    */    continue;    } else if (IDENTIFIER_IS_CONSTANT(id->identifier_flags)) {    if (id->func.const_info.offset >= 0) {    struct program *p2 = PROG_FROM_INT(p, e);
pike.git/src/program.c:11138:      /* returns 1 if a implements b */   static int low_implements(struct program *a, struct program *b)   {    int e;    struct pike_string *s=findstring("__INIT");    for(e=0;e<b->num_identifier_references;e++)    {    struct identifier *bid;    int i; -  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN)) +  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN|ID_VARIANT))    continue; /* Skip protected & hidden */    bid = ID_FROM_INT(b,e);    if(s == bid->name) continue; /* Skip __INIT */    i = find_shared_string_identifier(bid->name,a);    if (i == -1) {    if (b->identifier_references[e].id_flags & (ID_OPTIONAL))    continue; /* It's ok... */   #if 0    fprintf(stderr, "Missing identifier \"%s\"\n", bid->name->str);   #endif /* 0 */
pike.git/src/program.c:11219:    if (a->num_identifier_references < b->num_identifier_references) {    struct program *tmp = a;    a = b;    b = tmp;    }       for(e=0;e<b->num_identifier_references;e++)    {    struct identifier *bid;    int i; -  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN)) +  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN|ID_VARIANT))    continue; /* Skip protected & hidden */       /* FIXME: What if they aren't protected & hidden in a? */       bid = ID_FROM_INT(b,e);    if(s == bid->name) continue; /* Skip __INIT */    i = find_shared_string_identifier(bid->name,a);    if (i == -1) {    continue; /* It's ok... */    }
pike.git/src/program.c:11341:    }    SET_CYCLIC_RET(1);       a_file = get_program_line(a, &a_line);    b_file = get_program_line(b, &b_line);       for(e=0;e<b->num_identifier_references;e++)    {    struct identifier *bid;    int i; -  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN)) +  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN|ID_VARIANT))    continue; /* Skip protected & hidden */       /* FIXME: What if they aren't protected & hidden in a? */       bid = ID_FROM_INT(b,e);    if(s == bid->name) continue; /* Skip __INIT */    i = find_shared_string_identifier(bid->name,a);    if (i == -1) {    continue; /* It's ok... */    }
pike.git/src/program.c:11403:    }    SET_CYCLIC_RET(1);       a_file = get_program_line(a, &a_line);    b_file = get_program_line(b, &b_line);       for(e=0;e<b->num_identifier_references;e++)    {    struct identifier *bid;    int i; -  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN)) +  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN|ID_VARIANT))    continue; /* Skip protected & hidden */    bid = ID_FROM_INT(b,e);    if(s == bid->name) continue; /* Skip __INIT */    i = find_shared_string_identifier(bid->name,a);    if (i == -1) {    INT_TYPE bid_line = b_line;    struct pike_string *bid_file;    if (b->identifier_references[e].id_flags & (ID_OPTIONAL))    continue; /* It's ok... */    bid_file = get_identifier_line(b, e, &bid_line);
pike.git/src/program.c:11478:    if (BEGIN_CYCLIC(a, b)) {    END_CYCLIC();    return;    }    SET_CYCLIC_RET(1);       for(e=0;e<b->num_identifier_references;e++)    {    struct identifier *bid;    int i; -  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN)) +  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN|ID_VARIANT))    continue; /* Skip protected & hidden */       /* FIXME: What if they aren't protected & hidden in a? */       bid = ID_FROM_INT(b,e);    if(init_string == bid->name) continue; /* Skip __INIT */    i = find_shared_string_identifier(bid->name,a);    if (i == -1) {    continue; /* It's ok... */    }
pike.git/src/program.c:11534:    if (BEGIN_CYCLIC(a, b)) {    END_CYCLIC();    return;    }    SET_CYCLIC_RET(1);       for(e=0;e<b->num_identifier_references;e++)    {    struct identifier *bid;    int i; -  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN)) +  if (b->identifier_references[e].id_flags & (ID_PROTECTED|ID_HIDDEN|ID_VARIANT))    continue; /* Skip protected & hidden */    bid = ID_FROM_INT(b,e);    if(init_string == bid->name) continue; /* Skip __INIT */    i = find_shared_string_identifier(bid->name,a);    if (i == -1) {    if (b->identifier_references[e].id_flags & (ID_OPTIONAL))    continue; /* It's ok... */    ref_push_type_value(bid->type);    string_builder_sprintf(s,    "Missing identifier %O %S.\n",