Changeset: 87ab3b2ef525 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=87ab3b2ef525 Modified Files: monetdb5/mal/mal.h monetdb5/mal/mal_function.c monetdb5/mal/mal_instruction.c monetdb5/mal/mal_parser.c monetdb5/mal/mal_resolve.c monetdb5/mal/mal_session.c Branch: malparsing Log Message:
Remove unused flow-checked and type-checked from MAL block diffs (136 lines): diff --git a/monetdb5/mal/mal.h b/monetdb5/mal/mal.h --- a/monetdb5/mal/mal.h +++ b/monetdb5/mal/mal.h @@ -213,8 +213,6 @@ typedef struct MALBLK { sealedProp:1; /* sealed property (opertions for sealed object should be on the full object once) */ str errors; /* left over errors */ - int typefixed; /* no undetermined instruction */ - int flowfixed; /* all flow instructions are fixed */ struct MALBLK *history; /* of optimizer actions */ short keephistory; /* do we need the history at all */ int maxarg; /* keep track on the maximal arguments used */ diff --git a/monetdb5/mal/mal_function.c b/monetdb5/mal/mal_function.c --- a/monetdb5/mal/mal_function.c +++ b/monetdb5/mal/mal_function.c @@ -87,7 +87,6 @@ chkFlow(MalBlkPtr mb) InstrPtr stmt[DEPTH]; int btop=0; int endseen=0, retseen=0, yieldseen=0; - int fixed=1; InstrPtr p; str msg = MAL_SUCCEED; @@ -119,7 +118,6 @@ chkFlow(MalBlkPtr mb) } btop++; - if( p->typechk != TYPE_RESOLVED) fixed =0; break; case EXITsymbol: v= getDestVar(p); @@ -152,7 +150,6 @@ chkFlow(MalBlkPtr mb) p1->jump= pc[btop]+1; } } - if( p->typechk != TYPE_RESOLVED) fixed =0; break; case LEAVEsymbol: case REDOsymbol: @@ -164,7 +161,6 @@ chkFlow(MalBlkPtr mb) mb->errors = createMalException(mb,i,SYNTAX, "label '%s' not in guarded block", nme); } else - if( p->typechk != TYPE_RESOLVED) fixed =0; break; case YIELDsymbol: { InstrPtr ps= getInstrPtr(mb,0); @@ -196,7 +192,6 @@ chkFlow(MalBlkPtr mb) GDKfree(tpname); } } - if (ps->typechk != TYPE_RESOLVED) fixed = 0; } break; case RAISEsymbol: @@ -242,8 +237,6 @@ chkFlow(MalBlkPtr mb) if ( msg== MAL_SUCCEED && yieldseen && getArgType(mb,p,0)!= TYPE_void){ mb->errors = createMalException( mb,0,SYNTAX,"RETURN missing"); } - if( mb->errors == MAL_SUCCEED ) - mb->flowfixed = fixed; /* we might not have to come back here */ } /* diff --git a/monetdb5/mal/mal_instruction.c b/monetdb5/mal/mal_instruction.c --- a/monetdb5/mal/mal_instruction.c +++ b/monetdb5/mal/mal_instruction.c @@ -112,8 +112,6 @@ newMalBlk(int elements) mb->history = NULL; mb->keephistory = 0; mb->maxarg = MAXARG; /* the minimum for each instruction */ - mb->typefixed = 0; - mb->flowfixed = 0; mb->inlineProp = 0; mb->unsafeProp = 0; mb->sealedProp = 0; @@ -314,8 +312,6 @@ copyMalBlk(MalBlkPtr old) strncpy(mb->binding, old->binding, IDLENGTH); mb->errors = old->errors? GDKstrdup(old->errors):0; mb->tag = old->tag; - mb->typefixed = old->typefixed; - mb->flowfixed = old->flowfixed; mb->trap = old->trap; mb->runtime = old->runtime; mb->calls = old->calls; diff --git a/monetdb5/mal/mal_parser.c b/monetdb5/mal/mal_parser.c --- a/monetdb5/mal/mal_parser.c +++ b/monetdb5/mal/mal_parser.c @@ -947,8 +947,6 @@ fcnHeader(Client cntxt, int kind) setModuleId(curInstr,modnme); setFunctionId(curInstr,fnme); cntxt->curprg->kind = kind; - curBlk->flowfixed = 0; - curBlk->typefixed = 0; /* get calling parameters */ ch = *cntxt->lineptr; @@ -1193,11 +1191,11 @@ parseEnd(Client cntxt) if ((l == (int) strlen(getFunctionId(sig)) && strncmp(cntxt->lineptr, getFunctionId(sig), l) == 0) || l == 0) {} else { parseError(cntxt, "non matching end label\n"); + return 0; } advance(cntxt, l); pushEndInstruction(cntxt->curprg->def); cntxt->blkmode = 0; - cntxt->curprg->def->typefixed = 0; return 1; } return 0; diff --git a/monetdb5/mal/mal_resolve.c b/monetdb5/mal/mal_resolve.c --- a/monetdb5/mal/mal_resolve.c +++ b/monetdb5/mal/mal_resolve.c @@ -787,10 +787,6 @@ chkInstruction(Module s, MalBlkPtr mb, I void chkProgram(Module s, MalBlkPtr mb) { -/* it is not ready yet, too fragile - mb->typefixed = mb->stop == chk; ignored END */ -/* if( mb->flowfixed == 0)*/ - chkTypes(s, mb, FALSE); chkFlow(mb); chkDeclarations(mb); diff --git a/monetdb5/mal/mal_session.c b/monetdb5/mal/mal_session.c --- a/monetdb5/mal/mal_session.c +++ b/monetdb5/mal/mal_session.c @@ -101,8 +101,6 @@ MSresetClientPrg(Client cntxt) cntxt->itrace = 0; /* turn off any debugging */ mb = cntxt->curprg->def; - mb->typefixed = 0; - mb->flowfixed = 0; mb->stop = 1; mb->errors = MAL_SUCCEED; p = mb->stmt[0]; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list