Changeset: d7959489fd6b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d7959489fd6b
Modified Files:
        clients/Tests/exports.stable.out
        monetdb5/mal/mal_debugger.c
        monetdb5/mal/mal_interpreter.c
        monetdb5/mal/mal_interpreter.h
        monetdb5/mal/mal_resolve.c
        monetdb5/mal/mal_resolve.h
Branch: default
Log Message:

Remove useless code identified by linecoverage test


diffs (139 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -2019,7 +2019,6 @@ void expandMalBlk(MalBlkPtr mb, int line
 str expandRef;
 str exportOperationRef;
 str export_tableRef;
-int fcnBinder(stream *out, Module scope, MalBlkPtr mb, InstrPtr p);
 str fcnDefinition(MalBlkPtr mb, InstrPtr p, str s, int flg, str base, size_t 
len);
 int findGDKtype(int type);
 int findInstruction(Module scope, MalBlkPtr mb, InstrPtr pci);
@@ -2114,7 +2113,6 @@ str ilikethetasubselectRef;
 str ilikeuselectRef;
 void initHeartbeat(void);
 void initLibraries(void);
-void initMALstack(MalBlkPtr mb, MalStkPtr stk);
 void initNamespace(void);
 void initParser(void);
 void initProfiler(void);
diff --git a/monetdb5/mal/mal_debugger.c b/monetdb5/mal/mal_debugger.c
--- a/monetdb5/mal/mal_debugger.c
+++ b/monetdb5/mal/mal_debugger.c
@@ -523,10 +523,7 @@ retryRead:
                                for (i = 0; i < MAXSCOPE; i++) {
                                        fs = fsym->subscope[i];
                                        while (fs != NULL) {
-                                               if (fcnname == NULL)
-                                                       printSignature(out, fs, 
0);
-                                               else if (fs->def && 
strcmp(fcnname, getFcnName(fs->def)) == 0)
-                                                       printSignature(out, fs, 
0);
+                                               printSignature(out, fs, 0);
                                                fs = fs->peer;
                                        }
                                }
diff --git a/monetdb5/mal/mal_interpreter.c b/monetdb5/mal/mal_interpreter.c
--- a/monetdb5/mal/mal_interpreter.c
+++ b/monetdb5/mal/mal_interpreter.c
@@ -268,12 +268,6 @@ str malCommandCall(MalStkPtr stk, InstrP
                }\
        } 
 
-void 
-initMALstack(MalBlkPtr mb, MalStkPtr stk){
-       int i;
-       ValPtr lhs, rhs;
-       initStack(getInstrPtr(mb,0)->argc);
-}
 int
 isNotUsedIn(InstrPtr p, int start, int a)
 {
@@ -310,11 +304,6 @@ str runMAL(Client cntxt, MalBlkPtr mb, M
        str ret;
        (void) mbcaller;
 
-       if (mb->errors) {
-               if (cntxt->itrace == 0) /* permit debugger analysis */
-                       throw( MAL, "mal.interpreter", "Syntax error in 
script");
-       }
-
        /* Prepare a new interpreter call. This involves two steps, (1)
         * allocate the minimum amount of stack space needed, some slack
         * resources are included to permit code optimizers to add a few
diff --git a/monetdb5/mal/mal_interpreter.h b/monetdb5/mal/mal_interpreter.h
--- a/monetdb5/mal/mal_interpreter.h
+++ b/monetdb5/mal/mal_interpreter.h
@@ -28,7 +28,6 @@
 
 mal_export void showErrors(Client cntxt);
 mal_export MalStkPtr prepareMALstack(MalBlkPtr mb, int size);
-mal_export void initMALstack(MalBlkPtr mb, MalStkPtr stk);
 mal_export str runMAL(Client c, MalBlkPtr mb, MalBlkPtr mbcaller, MalStkPtr 
env);
 mal_export str runMALsequence(Client cntxt, MalBlkPtr mb, int startpc, int 
stoppc, MalStkPtr stk, MalStkPtr env, InstrPtr pcicaller);
 mal_export str reenterMAL(Client cntxt, MalBlkPtr mb, int startpc, int stoppc, 
MalStkPtr stk);
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
@@ -704,41 +704,6 @@ typeChecker(stream *out, Module scope, M
 }
 
 /*
- * Function binder
- * In some cases the front-end may already assure type correctness
- * of the MAL instruction generated (e.g. the SQL front-end)
- * In that case we merely have to locate the function address and
- * finalize the code for execution. Beware that we should be able to
- * distinguish the function by module name, function name, and
- * number of arguments only. Whether this is sufficient remains
- * to be seen.
- */
-int
-fcnBinder(stream *out, Module scope, MalBlkPtr mb, InstrPtr p)
-{
-       Module m = 0;
-       Symbol s;
-       int silent = FALSE;
-
-       if (p->token != ASSIGNsymbol)
-               return 0;
-       if (getModuleId(p) == NULL || getFunctionId(p) == NULL)
-               return 0;
-       for (m = findModule(scope, getModuleId(p)); m; m = m->outer)
-               if (m->name == getModuleId(p)) {
-                       s = m->subscope[(int) (getSubScope(getFunctionId(p)))];
-                       for (; s; s = s->peer)
-                               if (getFunctionId(p) == s->name &&
-                                       p->argc == getSignature(s)->argc) {
-                                       /* found it */
-                                       bindFunction(s, p, mb, out);
-                               }
-               }
-  wrapup:
-       return 0;
-}
-
-/*
  * After the parser finishes, we have to look for semantic errors,
  * such as flow of control problems and possible typeing conflicts.
  * The nesting of BARRIER and CATCH statements with their associated
@@ -762,8 +727,7 @@ chkTypes(stream *out, Module s, MalBlkPt
 
        for (i = 0; i < mb->stop; i++) {
                p = getInstrPtr(mb, i);
-               if (p == NULL)
-                       continue;
+               assert (p != NULL);
                typeChecker(out, s, mb, p, silent);
                if (mb->errors)
                        return;
diff --git a/monetdb5/mal/mal_resolve.h b/monetdb5/mal/mal_resolve.h
--- a/monetdb5/mal/mal_resolve.h
+++ b/monetdb5/mal/mal_resolve.h
@@ -23,7 +23,6 @@ mal_export void chkProgram(stream *out, 
 mal_export int chkInstruction(stream *out, Module s, MalBlkPtr mb, InstrPtr p);
 mal_export void chkTypes(stream *out, Module s, MalBlkPtr mb, int silent);
 mal_export void typeChecker(stream *out,  Module scope, MalBlkPtr mb, InstrPtr 
p, int silent);
-mal_export int fcnBinder(stream *out, Module scope, MalBlkPtr mb, InstrPtr p);
 
 extern str traceFcnName;
 mal_export void expandMacro(MalBlkPtr mb, InstrPtr p, MalBlkPtr mc);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to