/[ascend]/trunk/base/generic/compiler/instantiate.c
ViewVC logotype

Diff of /trunk/base/generic/compiler/instantiate.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 303 by johnpye, Tue Feb 21 02:38:13 2006 UTC revision 371 by johnpye, Tue Mar 14 05:04:06 2006 UTC
# Line 3866  void MakeInstance(CONST struct Name *nam Line 3866  void MakeInstance(CONST struct Name *nam
3866    struct TypeDescription *arydef;    struct TypeDescription *arydef;
3867    struct gl_list_t *indices;    struct gl_list_t *indices;
3868    int tce;    int tce;
3869      char *nstr;
3870      nstr = WriteNameString(name);
3871      CONSOLE_DEBUG(nstr);
3872      ascfree(nstr);
3873    if ((childname = SimpleNameIdPtr(name))!=NULL){ /* simple 1 element name */    if ((childname = SimpleNameIdPtr(name))!=NULL){ /* simple 1 element name */
3874      if (StatInFOR(statement) && StatWrong(statement)==0) {      if (StatInFOR(statement) && StatWrong(statement)==0) {
3875        MarkStatContext(statement,context_WRONG);        MarkStatContext(statement,context_WRONG);
# Line 4648  struct Instance *MakeRelationInstance(st Line 4652  struct Instance *MakeRelationInstance(st
4652                                        struct Statement *stat,                                        struct Statement *stat,
4653                                        enum Expr_enum type)                                        enum Expr_enum type)
4654  {  {
4655      CONSOLE_DEBUG("...");
4656    symchar *childname;    symchar *childname;
4657    struct Instance *child;    struct Instance *child;
4658    struct InstanceName rec;    struct InstanceName rec;
# Line 11317  void Pass3ProcessPendingInstances(void) Line 11322  void Pass3ProcessPendingInstances(void)
11322   * This is the singlepass phase2 with anontype sharing of   * This is the singlepass phase2 with anontype sharing of
11323   * relations implemented. If relations can depend on other   * relations implemented. If relations can depend on other
11324   * relations (as in future differential work) then this function   * relations (as in future differential work) then this function
11325   * Needs to be slightly more sophisticated.   * needs to be slightly more sophisticated.
11326   */   */
11327  static  static
11328  void Pass2ProcessPendingInstancesAnon(struct Instance *result)  void Pass2ProcessPendingInstancesAnon(struct Instance *result)
# Line 11333  void Pass2ProcessPendingInstancesAnon(st Line 11338  void Pass2ProcessPendingInstancesAnon(st
11338  #if TIMECOMPILER  #if TIMECOMPILER
11339    clock_t start,classt;    clock_t start,classt;
11340  #endif  #endif
11341      CONSOLE_DEBUG("...");
11342    
11343    /* pending will have at least one instance, or quick return. */    /* pending will have at least one instance, or quick return. */
11344    assert(PASS2MAXNUMBER==1);    assert(PASS2MAXNUMBER==1);
# Line 11989  static Line 11995  static
11995  struct Instance *Pass2InstantiateModel(struct Instance *result,  struct Instance *Pass2InstantiateModel(struct Instance *result,
11996                                         unsigned long *pcount)                                         unsigned long *pcount)
11997  {  {
11998      CONSOLE_DEBUG("starting...");
11999    /* do we need a ForTable on the stack here? don't think so. np2ppi does it */    /* do we need a ForTable on the stack here? don't think so. np2ppi does it */
12000    if (result!=NULL) {    if (result!=NULL) {
12001        CONSOLE_DEBUG("result!=NULL...");
12002      /* pass2 pendings already set by visit */      /* pass2 pendings already set by visit */
12003      if (ANONFORCE || g_use_copyanon != 0) {      if (ANONFORCE || g_use_copyanon != 0) {
12004  #if TIMECOMPILER  #if TIMECOMPILER
# Line 12014  struct Instance *Pass2InstantiateModel(s Line 12022  struct Instance *Pass2InstantiateModel(s
12022      }      }
12023      ClearList();      ClearList();
12024    }    }
12025      CONSOLE_DEBUG("...done");
12026    return result;    return result;
12027  }  }
12028    
# Line 12025  void Pass2SetRelationBits(struct Instanc Line 12034  void Pass2SetRelationBits(struct Instanc
12034      struct BitList *blist;      struct BitList *blist;
12035  #ifdef DEBUG_RELS  #ifdef DEBUG_RELS
12036      ERROR_REPORTER_START_NOLINE(ASC_PROG_NOTE);      ERROR_REPORTER_START_NOLINE(ASC_PROG_NOTE);
12037      FPRINTF(stderr,"P2SRB: ");      FPRINTF(ASCERR,"P2SRB: ");
12038      WriteInstanceName(ASCERR,inst,debug_rels_work);      WriteInstanceName(ASCERR,inst,debug_rels_work);
12039        FPRINTF(ASCERR,"\n");
12040      error_reporter_end_flush();      error_reporter_end_flush();
12041  #endif  #endif
12042    
# Line 12204  struct Instance *NewInstantiateModel(str Line 12214  struct Instance *NewInstantiateModel(str
12214    FPRINTF(ASCERR,"Phase 2 relations \t\t%lu\n",    FPRINTF(ASCERR,"Phase 2 relations \t\t%lu\n",
12215      (unsigned long)(phase2t-phase1t));      (unsigned long)(phase2t-phase1t));
12216  #endif  #endif
12217      CONSOLE_DEBUG("Starting phase 3...");
12218    /* at this point, there may be unexecuted non-logical relation    /* at this point, there may be unexecuted non-logical relation
12219     * statements, but they can never be executed. The     * statements, but they can never be executed. The
12220     * pending list is therefore empty. We know how many.     * pending list is therefore empty. We know how many.
# Line 12326  struct Instance *NewRealInstantiate(stru Line 12337  struct Instance *NewRealInstantiate(stru
12337                                   int intset)                                   int intset)
12338  {  {
12339    struct Instance *result;    struct Instance *result;
12340      CONSOLE_DEBUG("...");
12341    
12342    result = ShortCutMakeUniversalInstance(def); /*does quick Universal check */    result = ShortCutMakeUniversalInstance(def); /*does quick Universal check */
12343    if (result) return result;    if (result) return result;

Legend:
Removed from v.303  
changed lines
  Added in v.371

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22