Branch: Tag:

2010-11-11

2010-11-11 14:34:28 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Reduce PROGRAM_*_PARENT inflation further.

Don't mark external constants that have local scope as having external dependencies.
Only mark programs used by externals having external dependencies as needing parent objects.
Tentatively fixes [lyslyskom 18781511].

1185:    /* FIXME */    if(IDENTIFIER_IS_CONSTANT(id->identifier_flags))    { +  if (!(PTR_FROM_INT(parent_prog, i)->id_flags & ID_LOCAL)) { +  /* It's possible to overload the identifier. */    res->node_info = OPT_EXTERNAL_DEPEND; -  +  } else { +  struct svalue *s = &parent_prog->constants[id->func.offset].sval; +  if ((s->type == T_PROGRAM) && +  (s->u.program->flags & PROGRAM_USES_PARENT)) { +  /* The constant program refers to its parent, so we need as well. */ +  res->node_info = OPT_EXTERNAL_DEPEND; +  } +  }    }else{    res->node_info = OPT_NOT_CONST;    if (IDENTIFIER_IS_VARIABLE(id->identifier_flags) &&