summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tclCompCmds.c20
-rw-r--r--generic/tclCompCmdsGR.c10
-rw-r--r--generic/tclCompCmdsSZ.c12
-rw-r--r--generic/tclCompile.h5
-rw-r--r--generic/tclEnsemble.c4
5 files changed, 24 insertions, 27 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index 28a3e64..a56727d 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -610,7 +610,7 @@ TclCompileCatchCmd(
* begin by undeflowing the stack below the mark set by BEGIN_CATCH4.
*/
- LineInformation(1);
+ SetLineInformation(1);
if (cmdTokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
@@ -1467,7 +1467,7 @@ CompileDictEachCmd(
* Compile the loop body itself. It should be stack-neutral.
*/
- LineInformation(3);
+ SetLineInformation(3);
CompileBody(envPtr, bodyTokenPtr, interp);
if (collect == TCL_EACH_COLLECT) {
Emit14Inst( INST_LOAD_SCALAR, keyVarIndex, envPtr);
@@ -1651,7 +1651,7 @@ TclCompileDictUpdateCmd(
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
- LineInformation(parsePtr->numWords - 1);
+ SetLineInformation(parsePtr->numWords - 1);
CompileBody(envPtr, bodyTokenPtr, interp);
ExceptionRangeEnds(envPtr, range);
@@ -1992,7 +1992,7 @@ TclCompileDictWithCmd(
TclEmitInstInt4( INST_BEGIN_CATCH4, range, envPtr);
ExceptionRangeStarts(envPtr, range);
- LineInformation(parsePtr->numWords-1);
+ SetLineInformation(parsePtr->numWords-1);
CompileBody(envPtr, tokenPtr, interp);
ExceptionRangeEnds(envPtr, range);
@@ -2268,7 +2268,7 @@ TclCompileForCmd(
* Inline compile the initial command.
*/
- LineInformation(1);
+ SetLineInformation(1);
CompileBody(envPtr, startTokenPtr, interp);
TclEmitOpcode(INST_POP, envPtr);
@@ -2292,7 +2292,7 @@ TclCompileForCmd(
bodyRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
bodyCodeOffset = ExceptionRangeStarts(envPtr, bodyRange);
- LineInformation(4);
+ SetLineInformation(4);
CompileBody(envPtr, bodyTokenPtr, interp);
ExceptionRangeEnds(envPtr, bodyRange);
TclEmitOpcode(INST_POP, envPtr);
@@ -2306,7 +2306,7 @@ TclCompileForCmd(
nextRange = TclCreateExceptRange(LOOP_EXCEPTION_RANGE, envPtr);
envPtr->exceptAuxArrayPtr[nextRange].supportsContinue = 0;
nextCodeOffset = ExceptionRangeStarts(envPtr, nextRange);
- LineInformation(3);
+ SetLineInformation(3);
CompileBody(envPtr, nextTokenPtr, interp);
ExceptionRangeEnds(envPtr, nextRange);
TclEmitOpcode(INST_POP, envPtr);
@@ -2325,7 +2325,7 @@ TclCompileForCmd(
testCodeOffset += 3;
}
- LineInformation(2);
+ SetLineInformation(2);
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
@@ -2644,7 +2644,7 @@ CompileEachloopCmd(
i < numWords-1;
i++, tokenPtr = TokenAfter(tokenPtr)) {
if ((i%2 == 0) && (i > 0)) {
- LineInformation(i);
+ SetLineInformation(i);
CompileTokens(envPtr, tokenPtr, interp);
tempVar = (firstValueTemp + loopIndex);
Emit14Inst( INST_STORE_SCALAR, tempVar, envPtr);
@@ -2682,7 +2682,7 @@ CompileEachloopCmd(
* Inline compile the loop body.
*/
- LineInformation(numWords - 1);
+ SetLineInformation(numWords - 1);
ExceptionRangeStarts(envPtr, range);
CompileBody(envPtr, bodyTokenPtr, interp);
ExceptionRangeEnds(envPtr, range);
diff --git a/generic/tclCompCmdsGR.c b/generic/tclCompCmdsGR.c
index 32514ab..f7c15e6 100644
--- a/generic/tclCompCmdsGR.c
+++ b/generic/tclCompCmdsGR.c
@@ -222,7 +222,7 @@ TclCompileIfCmd(
compileScripts = 0;
}
} else {
- LineInformation(wordIdx);
+ SetLineInformation(wordIdx);
Tcl_ResetResult(interp);
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
if (jumpFalseFixupArray.next >= jumpFalseFixupArray.end) {
@@ -264,7 +264,7 @@ TclCompileIfCmd(
*/
if (compileScripts) {
- LineInformation(wordIdx);
+ SetLineInformation(wordIdx);
CompileBody(envPtr, tokenPtr, interp);
}
@@ -345,7 +345,7 @@ TclCompileIfCmd(
* Compile the else command body.
*/
- LineInformation(wordIdx);
+ SetLineInformation(wordIdx);
CompileBody(envPtr, tokenPtr, interp);
}
@@ -474,7 +474,7 @@ TclCompileIncrCmd(
PushLiteral(envPtr, word, numBytes);
}
} else {
- LineInformation(2);
+ SetLineInformation(2);
CompileTokens(envPtr, incrTokenPtr, interp);
}
} else { /* No incr amount given so use 1. */
@@ -701,7 +701,7 @@ TclCompileInfoLevelCmd(
* list of arguments.
*/
- LineInformation(1);
+ SetLineInformation(1);
CompileTokens(envPtr, TokenAfter(parsePtr->tokenPtr), interp);
TclEmitOpcode( INST_INFO_LEVEL_ARGS, envPtr);
}
diff --git a/generic/tclCompCmdsSZ.c b/generic/tclCompCmdsSZ.c
index d5208e6..0497e8a 100644
--- a/generic/tclCompCmdsSZ.c
+++ b/generic/tclCompCmdsSZ.c
@@ -86,7 +86,7 @@ const AuxDataType tclJumptableInfoType = {
#define OP44(name,val1,val2) \
TclEmitInstInt4(INST_##name,(val1),envPtr);TclEmitInt4((val2),envPtr)
#define BODY(token,index) \
- LineInformation((index));CompileBody(envPtr,(token),interp)
+ SetLineInformation((index));CompileBody(envPtr,(token),interp)
#define PUSH(str) \
PushStringLiteral(envPtr, str)
#define JUMP4(name,var) \
@@ -433,7 +433,7 @@ TclCompileStringMatchCmd(
}
PushLiteral(envPtr, str, length);
} else {
- LineInformation(i+1+nocase);
+ SetLineInformation(i+1+nocase);
CompileTokens(envPtr, tokenPtr, interp);
}
tokenPtr = TokenAfter(tokenPtr);
@@ -483,7 +483,7 @@ TclCompileStringLenCmd(
len = sprintf(buf, "%d", len);
PushLiteral(envPtr, buf, len);
} else {
- LineInformation(1);
+ SetLineInformation(1);
CompileTokens(envPtr, tokenPtr, interp);
TclEmitOpcode(INST_STR_LEN, envPtr);
}
@@ -722,7 +722,7 @@ TclCompileSubstCmd(
return TCL_ERROR;
}
- LineInformation(numArgs);
+ SetLineInformation(numArgs);
TclSubstCompile(interp, wordTokenPtr[1].start, wordTokenPtr[1].size,
flags, mapPtr->loc[eclIndex].line[numArgs], envPtr);
@@ -1284,7 +1284,7 @@ TclCompileSwitchCmd(
*/
/* Both methods push the value to match against onto the stack. */
- LineInformation(valueIndex);
+ SetLineInformation(valueIndex);
CompileTokens(envPtr, valueTokenPtr, interp);
if (mode == Switch_Exact) {
@@ -3026,7 +3026,7 @@ TclCompileWhileCmd(
bodyCodeOffset += 3;
testCodeOffset += 3;
}
- LineInformation(1);
+ SetLineInformation(1);
TclCompileExprWords(interp, testTokenPtr, 1, envPtr);
jumpDist = CurrentOffset(envPtr) - bodyCodeOffset;
diff --git a/generic/tclCompile.h b/generic/tclCompile.h
index 5043f65..9af4911 100644
--- a/generic/tclCompile.h
+++ b/generic/tclCompile.h
@@ -1537,13 +1537,10 @@ MODULE_SCOPE Tcl_Obj *TclNewInstNameObj(unsigned char inst);
ExtCmdLoc *mapPtr = envPtr->extCmdMapPtr; \
int eclIndex = mapPtr->nuloc - 1
-#define LineInformation(word) \
+#define SetLineInformation(word) \
envPtr->line = mapPtr->loc[eclIndex].line[(word)]; \
envPtr->clNext = mapPtr->loc[eclIndex].next[(word)]
-#define SetLineInformation(word)
-
-
#define PushVarNameWord(i,v,e,f,l,sc,word) \
TclPushVarName(i,v,e,f,l,sc, \
mapPtr->loc[eclIndex].line[(word)], \
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index 794a059..0bb7cb6 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -3180,7 +3180,7 @@ CompileToInvokedCommand(
}
TclEmitPush(literal, envPtr);
} else {
- LineInformation(i);
+ SetLineInformation(i);
CompileTokens(envPtr, tokPtr, interp);
}
tokPtr = TokenAfter(tokPtr);
@@ -3257,7 +3257,7 @@ CompileBasicNArgCommand(
if (tokenPtr->type == TCL_TOKEN_SIMPLE_WORD) {
PushLiteral(envPtr, tokenPtr[1].start, tokenPtr[1].size);
} else {
- LineInformation(i);
+ SetLineInformation(i);
CompileTokens(envPtr, tokenPtr, interp);
}
tokenPtr = TokenAfter(tokenPtr);