]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
More changes to take advantage of the TK_ and OP_ alignments to avoid
authordrh <drh@noemail.net>
Mon, 4 Oct 2004 13:38:09 +0000 (13:38 +0000)
committerdrh <drh@noemail.net>
Mon, 4 Oct 2004 13:38:09 +0000 (13:38 +0000)
unnecessary translations. (CVS 1999)

FossilOrigin-Name: e8e972ba65fc36171f6b685e8a8f67f93452e031

manifest
manifest.uuid
src/parse.y
src/where.c

index df40a7a6c2a5c358be69331ba0313b7dce91b6c5..e164f8a878d4f620da021c56d93e4fc9d003efb5 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Save\sabout\s800\sbytes\sof\scode\sspace\sby\saligning\sTK_\sand\sOP_\sconstants\sso\sthat\nwe\sdo\snot\shave\sto\stranslate\sbetween\sthem.\s(CVS\s1998)
-D 2004-10-04T13:19:24
+C More\schanges\sto\stake\sadvantage\sof\sthe\sTK_\sand\sOP_\salignments\sto\savoid\nunnecessary\stranslations.\s(CVS\s1999)
+D 2004-10-04T13:38:09
 F Makefile.in 78ddc9fca09ab6e3b75a79ecf8d490e34cd0519c
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -54,7 +54,7 @@ F src/os_win.c 9482dfc92f289b68205bb2c9315757c7e3946bfb
 F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
 F src/pager.c d3688828d314135ef0cd87b4d892805136c4168f
 F src/pager.h 67739fe649f33be55dba522ca8a9cc4e42d14f71
-F src/parse.y eb4920f637b4e44e038220e67dac07854bfd6325
+F src/parse.y 3616bdde17fd9be9c235e40cd732a831a3e8fa61
 F src/pragma.c 45978cc82fdf91f00d024a8e875c2b679fbce488
 F src/printf.c 40770e1f553612d13dfc86d236086e69baa62fe1
 F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
@@ -81,7 +81,7 @@ F src/vdbeInt.h 6017100adff362b8dfa37a69e3f1431f084bfa5b
 F src/vdbeapi.c 81ab9e84c55f5762f552904e6e5d309269b02017
 F src/vdbeaux.c a43a2989eeb3a478b31dba2fc28578bbb2d6366e
 F src/vdbemem.c ef9ac7d32acfe4bce5c5b408b1294c8d9e0cdb56
-F src/where.c 04d3ee039d8e66c520e3b6bd5103dc3b8c3eb76b
+F src/where.c 6e637a6b3e61fe3104adc4e5caa4738bf6570daa
 F test/all.test 929bfa932b55e75c96fe2203f7650ba451c1862c
 F test/attach.test feb2ce54e78688df4c84553416d5aec3b2a0112e
 F test/attach2.test 32ca2c1a5a347a7404219a11f9f84739a63d2582
@@ -249,7 +249,7 @@ F www/tclsqlite.tcl 560ecd6a916b320e59f2917317398f3d59b7cc25
 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
-P c4697503d0ad080290b91e96dfc9a1a63f2df7e6
-R 7fe455a514dce92e3703ce1da8317d3a
+P 4c817e3f293a9c1365e632f7dc13ae440263332a
+R baa88e3ccdeca2bd21538a311420eedc
 U drh
-Z 28445a4252d9b9c0f55f4514219ea5c1
+Z f63cffc592cc58b47f0dd722884db290
index 40870d1930fccf4803bf681810e3a8c995948f77..d6cfef77c7c9ccaeb66b57866c540995bf528713 100644 (file)
@@ -1 +1 @@
-4c817e3f293a9c1365e632f7dc13ae440263332a
\ No newline at end of file
+e8e972ba65fc36171f6b685e8a8f67f93452e031
\ No newline at end of file
index 5999e21465245ba34b47fc03f087f5ca1d6d42e2..c8a95f5523a0d4a0bba86bfb949f2b1c2a2a125f 100644 (file)
@@ -14,7 +14,7 @@
 ** the parser.  Lemon will also generate a header file containing
 ** numeric codes for all of the tokens.
 **
-** @(#) $Id: parse.y,v 1.140 2004/10/04 13:19:24 drh Exp $
+** @(#) $Id: parse.y,v 1.141 2004/10/04 13:38:09 drh Exp $
 */
 %token_prefix TK_
 %token_type {Token}
@@ -147,7 +147,7 @@ id(A) ::= ID(X).         {A = X;}
 %left AND.
 %right NOT.
 %left IS LIKE GLOB BETWEEN IN ISNULL NOTNULL NE EQ.
-%left GT LE GE LT.
+%left GT LE LT GE.
 %left BITAND BITOR LSHIFT RSHIFT.
 %left PLUS MINUS.
 %left STAR SLASH REM.
index 4110431e423202270c1be9ba4a28f9a10b2d2e80..eb51bdfac8fb3f2cb925275584dace6ab164a4c6 100644 (file)
@@ -12,7 +12,7 @@
 ** This module contains C code that generates VDBE code used to process
 ** the WHERE clause of SQL statements.
 **
-** $Id: where.c,v 1.115 2004/09/25 13:12:16 drh Exp $
+** $Id: where.c,v 1.116 2004/10/04 13:38:09 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -148,17 +148,8 @@ static int exprTableUsage(ExprMaskSet *pMaskSet, Expr *p){
 ** "=", "<", ">", "<=", ">=", and "IN".
 */
 static int allowedOp(int op){
-  switch( op ){
-    case TK_LT:
-    case TK_LE:
-    case TK_GT:
-    case TK_GE:
-    case TK_EQ:
-    case TK_IN:
-      return 1;
-    default:
-      return 0;
-  }
+  assert( TK_GT==TK_LE-1 && TK_LE==TK_LT-1 && TK_LT==TK_GE-1 && TK_EQ==TK_GT-1);
+  return op==TK_IN || (op>=TK_EQ && op<=TK_GE);
 }
 
 /*
@@ -221,12 +212,13 @@ static void exprAnalyze(SrcList *pSrc, ExprMaskSet *pMaskSet, ExprInfo *pInfo){
       assert( pExpr->op!=TK_IN );
       SWAP(CollSeq*,pExpr->pRight->pColl,pExpr->pLeft->pColl);
       SWAP(Expr*,pExpr->pRight,pExpr->pLeft);
-      switch( pExpr->op ){
-        case TK_LT:   pExpr->op = TK_GT;  break;
-        case TK_LE:   pExpr->op = TK_GE;  break;
-        case TK_GT:   pExpr->op = TK_LT;  break;
-        case TK_GE:   pExpr->op = TK_LE;  break;
-        default:      break;
+      if( pExpr->op>=TK_GT ){
+        assert( TK_LT==TK_GT+2 );
+        assert( TK_GE==TK_LE+2 );
+        assert( TK_GT>TK_EQ );
+        assert( TK_GT<TK_LE );
+        assert( pExpr->op>=TK_GT && pExpr->op<=TK_GE );
+        pExpr->op = ((pExpr->op-TK_GT)^2)+TK_GT;
       }
       SWAP(unsigned, pInfo->prereqLeft, pInfo->prereqRight);
       SWAP(short int, pInfo->idxLeft, pInfo->idxRight);