Changeset: da7616da5910 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=da7616da5910
Modified Files:
        sql/backends/monet5/datacell/opt_datacell.c
        sql/backends/monet5/datacell/opt_datacell.h
Branch: Feb2013
Log Message:

First pass of cleaning up datacell optimizer
At least it does not end in a recursive optimizer loop.
The actual code produced should reflect the lastest SQL
infrastructure still.


diffs (79 lines):

diff --git a/sql/backends/monet5/datacell/opt_datacell.c 
b/sql/backends/monet5/datacell/opt_datacell.c
--- a/sql/backends/monet5/datacell/opt_datacell.c
+++ b/sql/backends/monet5/datacell/opt_datacell.c
@@ -265,64 +265,3 @@ OPTdatacellImplementation(Client cntxt, 
        return actions;
 }
 
-/* #define _DEBUG_OPTIMIZER_*/
-
-str OPTdatacell(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr p)
-{
-       str modnme;
-       str fcnnme;
-       str msg = MAL_SUCCEED;
-       Symbol s = NULL;
-       lng t = 0, clk = GDKusec();
-       int actions = 0;
-
-       optimizerInit();
-       if (p)
-               removeInstruction(mb, p);
-       OPTDEBUGdatacell mnstr_printf(cntxt->fdout, "=APPLY OPTIMIZER 
datacell\n");
-       if (p && p->argc > 1) {
-               if (getArgType(mb, p, 1) != TYPE_str ||
-                       getArgType(mb, p, 2) != TYPE_str ||
-                       !isVarConstant(mb, getArg(p, 1)) ||
-                       !isVarConstant(mb, getArg(p, 2))
-                       ) {
-                       throw(MAL, "optimizer.datacell", ILLARG_CONSTANTS);
-               }
-               if (stk != 0) {
-                       modnme = *(str *) getArgReference(stk, p, 1);
-                       fcnnme = *(str *) getArgReference(stk, p, 2);
-               } else {
-                       modnme = getArgDefault(mb, p, 1);
-                       fcnnme = getArgDefault(mb, p, 2);
-               }
-               s = findSymbol(cntxt->nspace, putName(modnme, strlen(modnme)), 
putName(fcnnme, strlen(fcnnme)));
-
-               if (s == NULL) {
-                       char buf[1024];
-                       snprintf(buf, 1024, "%s.%s", modnme, fcnnme);
-                       throw(MAL, "optimizer.datacell", 
RUNTIME_OBJECT_UNDEFINED ":%s", buf);
-               }
-               mb = s->def;
-               stk = 0;
-       }
-       if (mb->errors) {
-               /* when we have errors, we still want to see them */
-               addtoMalBlkHistory(mb, "datacell");
-               return MAL_SUCCEED;
-       }
-       actions = OPTdatacellImplementation(cntxt, mb, stk, p);
-       addOptimizers(cntxt, mb);
-       if (msg == MAL_SUCCEED)
-               msg = optimizeMALBlock(cntxt, mb);
-       if (msg == MAL_SUCCEED)
-               msg = optimizerCheck(cntxt, mb, "optimizer.datacell", actions, 
t = (GDKusec() - clk), OPT_CHECK_ALL);
-       OPTDEBUGdatacell {
-               mnstr_printf(cntxt->fdout, "=FINISHED datacell %d\n", actions);
-               printFunction(cntxt->fdout, mb, 0, LIST_MAL_STMT | LIST_MAPI);
-       }
-       DEBUGoptimizers
-               mnstr_printf(cntxt->fdout, "#opt_reduce: " LLFMT " ms\n", t);
-       QOTupdateStatistics("datacell", actions, t);
-       addtoMalBlkHistory(mb, "datacell");
-       return msg;
-}
diff --git a/sql/backends/monet5/datacell/opt_datacell.h 
b/sql/backends/monet5/datacell/opt_datacell.h
--- a/sql/backends/monet5/datacell/opt_datacell.h
+++ b/sql/backends/monet5/datacell/opt_datacell.h
@@ -24,7 +24,5 @@
 #include "opt_pipes.h"
 
 #define OPTDEBUGdatacell  if (optDebug & (1 << DEBUG_OPT_DATACELL))
-opt_export str OPTdatacell(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr 
p);
 opt_export int OPTdatacellImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr 
stk, InstrPtr pci);
-opt_export str OPTdatacellPrelude(Client cntxt, MalBlkPtr mb, MalStkPtr stk, 
InstrPtr p);
 #endif
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to