]> andersk Git - splint.git/commitdiff
Fixed Makefile to create bin directory.
authordrl7x <drl7x>
Mon, 8 Oct 2001 22:54:59 +0000 (22:54 +0000)
committerdrl7x <drl7x>
Mon, 8 Oct 2001 22:54:59 +0000 (22:54 +0000)
Makefile.in
src/Headers/herald.h [deleted file]
src/Headers/herald.last [deleted file]
src/Headers/local_constants.h [deleted file]
src/Headers/local_constants.last
src/Makefile
src/Makefile.sources
src/forjunk.c [deleted file]
src/maketags

index 8a23bf60e4da399491c219b579603f7842bb6a23..dc2413ba1fa3c9eccc9c5f86fcc47121a07f6346 100644 (file)
@@ -179,6 +179,7 @@ endif
        @echo '// '
        @echo '//  Run: '$(MAKE)' test to check'
        @echo '// '
+       -mkdir bin
        mv src/lclint bin/lclint
 
 test:
diff --git a/src/Headers/herald.h b/src/Headers/herald.h
deleted file mode 100644 (file)
index eab9d94..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* herald.h - created automatically by gmake updateversion */
-/*@constant observer char *LCL_VERSION;@*/
-# define LCL_VERSION "LCLint 3.0.0.18 --- 5 October 2001"
-/*@constant observer char *LCL_PARSE_VERSION;@*/
-# define LCL_PARSE_VERSION "LCLint 3.0.0.18"
-/*@constant observer char *LCL_COMPILE;@*/
-# define LCL_COMPILE "Compiled using gcc -Wall -g on Linux paisley 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by evans"
diff --git a/src/Headers/herald.last b/src/Headers/herald.last
deleted file mode 100644 (file)
index eab9d94..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* herald.h - created automatically by gmake updateversion */
-/*@constant observer char *LCL_VERSION;@*/
-# define LCL_VERSION "LCLint 3.0.0.18 --- 5 October 2001"
-/*@constant observer char *LCL_PARSE_VERSION;@*/
-# define LCL_PARSE_VERSION "LCLint 3.0.0.18"
-/*@constant observer char *LCL_COMPILE;@*/
-# define LCL_COMPILE "Compiled using gcc -Wall -g on Linux paisley 2.4.3-12 #1 Fri Jun 8 13:35:30 EDT 2001 i686 unknown by evans"
diff --git a/src/Headers/local_constants.h b/src/Headers/local_constants.h
deleted file mode 100644 (file)
index 59668c3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-/* local_constants.h - created automatically by gmake localconstants */
-/*@constant observer char *SYSTEM_LIBDIR;@*/
-# define SYSTEM_LIBDIR "/usr/include"
-/*@constant observer char *DEFAULT_LARCHPATH;@*/
-# define DEFAULT_LARCHPATH "/usr/local/lclint/lib"
-/*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/
-# define DEFAULT_LCLIMPORTDIR "/usr/local/lclint/imports"
index 59668c381b0bfeadad196ce9509be87760bdd51f..36be59add50c4bc06d6b1d4ba670fd21a6a2e1a7 100644 (file)
@@ -2,6 +2,6 @@
 /*@constant observer char *SYSTEM_LIBDIR;@*/
 # define SYSTEM_LIBDIR "/usr/include"
 /*@constant observer char *DEFAULT_LARCHPATH;@*/
-# define DEFAULT_LARCHPATH "/usr/local/lclint/lib"
+# define DEFAULT_LARCHPATH ".:/tmp/LCLintDev/lib"
 /*@constant observer char *DEFAULT_LCLIMPORTDIR;@*/
-# define DEFAULT_LCLIMPORTDIR "/usr/local/lclint/imports"
+# define DEFAULT_LCLIMPORTDIR "/tmp/LCLintDev/imports"
index af7f0af7f986ff179752d6cb9e39c5f2f2dc8780..1ee57f017746cef4786e2237fe7b46f13256f47a 100644 (file)
@@ -76,9 +76,6 @@ lclint : $(OBJ)
        @echo '// '
        $(CC) -o lclint $(OBJ) $(LINKFLAGS)
 
-purify: ${OBJ}
-       purify ${CC} -o lclint ${OBJ} ${LINKFLAGS}
-
 ###
 ### grammars
 ###
@@ -174,6 +171,7 @@ Headers/signature2.h : signature.c
 Headers/signature_gen.h : signature.c
 Headers/cgrammar2.h : cgrammar.c
 Headers/cgrammar_tokens.h : cgrammar.c
+Headers/llgrammar_gen.h: llgrammar.c
 Headers/llgrammar.h : llgrammar.c
 Headers/mtgrammar_tokens.h : mtgrammar.c
 
@@ -193,7 +191,7 @@ LCLINT29 = ${HOME}/lclint-2.9c/src/lclint
        -../bin/lclint $(CPPFLAGS) $(LINTFLAGS) $(SINGLEFLAGS) -load lclint.lcd +neverinclude $*.c +showsourceloc -mts file
 #      -$(LCLINT29) $(CPPFLAGS) $(LINTFLAGS) $(SINGLEFLAGS) -load lclint.lcd +neverinclude $*.c +showsourceloc
 
-lcllib.c: Headers/llgrammar.h
+lcllib.c: Headers/llgrammar.h Headers/llgrammar_gen.h
 clabstract.c: Headers/cgrammar_tokens.h 
 scan.c: Headers/signature2.h  Headers/signature_gen.h
 stateClause.c: Headers/cgrammar_tokens.h 
@@ -273,7 +271,7 @@ updateversion:
        @echo '# define LCL_COMPILE "Compiled using '$(CC)' on '`uname -a`' by '`whoami`'"' >> Headers/herald.h
 
 localconstants:
-       @$(MV) Headers/local_constants.h Headers/local_constants.last
+       @-$(MV) Headers/local_constants.h Headers/local_constants.last
        @echo '/* local_constants.h - created automatically by gmake localconstants */' \
                 > Headers/local_constants.h
 ifndef SYSTEM_LIBDIR
index 7281241c753f7f80c86264c0fb51371933716fd4..3cbacf5ba9a66645e8eb054087835badb01bb60b 100644 (file)
@@ -35,7 +35,7 @@ OVERFLOWCHSRC = \
     constraintList.c \
     constraintResolve.c \
     constraintOutput.c \
-    forjunk.c 
+    loopHeuristics.c 
     
 GENERALSRC =  \
     exprData.c \
diff --git a/src/forjunk.c b/src/forjunk.c
deleted file mode 100644 (file)
index 5e36d9e..0000000
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
-** forjunk.c
-*/
-
-/* #define DEBUGPRINT 1 */
-
-# include <ctype.h> /* for isdigit */
-# include "lclintMacros.nf"
-# include "basic.h"
-# include "cgrammar.h"
-# include "cgrammar_tokens.h"
-
-# include "exprChecks.h"
-# include "exprNodeSList.h"
-
-# include "exprDataQuite.i"
-
-/*@access constraint, exprNode @*/
-
-/*@access constraintExpr @*/
-
-static bool isInc (/*@observer@*/ constraintExpr c) /*@*/
-{
-  
-  llassert(constraintExpr_isDefined(c) );
- if (c->kind == binaryexpr )
-    {
-      constraintExprBinaryOpKind binOP;
-      constraintExpr t1, t2;
-      t1 = constraintExprData_binaryExprGetExpr1 (c->data);
-      t2 = constraintExprData_binaryExprGetExpr2 (c->data);
-
-      binOP = constraintExprData_binaryExprGetOp (c->data);
-      if (binOP == BINARYOP_PLUS)
-       if (constraintExpr_isLit (t2) && constraintExpr_getValue (t2) == 1 )
-         {
-           return TRUE;
-         }
-    }
-
- return FALSE;
-}
-
-/* look for constraints like cexrp = cexrp + 1 */
-static bool incVar (/*@notnull@*/ constraint c) /*@*/
-{
-  constraintExpr t1;
-  if (c->ar != EQ)
-    {
-      return FALSE;
-    }
-  if (! isInc (c->expr ) )
-    return FALSE;
-
-  llassert (constraintExpr_isDefined(c->expr) );
-  llassert (c->expr->kind == binaryexpr);
-
-  t1 = constraintExprData_binaryExprGetExpr1 (c->expr->data);
-  if (constraintExpr_similar (c->lexpr, t1) )
-    return TRUE;
-
-  return FALSE;
-}
-/*@noaccess constraintExpr @*/
-
-
-static bool increments (/*@observer@*/ constraint c,
-                       /*@observer@*/ constraintExpr var)
-{
-  llassert(constraint_isDefined(c) );
-
-  if (constraint_isUndefined(c) )
-    {
-      return FALSE;
-    }
-
-  llassert (incVar (c));
-  if (constraintExpr_similar (c->lexpr, var) )
-    return TRUE;
-  else
-    return FALSE;
-}
-
-static bool canGetForTimes (/*@notnull@*/ exprNode forPred, /*@notnull@*/ exprNode forBody)
-{
-  
-  exprNode init, test, inc, t1, t2;
-  lltok tok;
-  
-  llassert(exprNode_isDefined (forPred) );
-  llassert(exprNode_isDefined (forBody) );
-
-  init  =  exprData_getTripleInit (forPred->edata);
-  test  =   exprData_getTripleTest (forPred->edata);
-  inc   =   exprData_getTripleInc (forPred->edata);
-
-  llassert(exprNode_isDefined(test) );
-
-  if (exprNode_isUndefined(test) )
-    {
-      return FALSE;
-    }
-
-  llassert(exprNode_isDefined(inc) );
-
-  if (exprNode_isUndefined(inc) )
-    {
-      return FALSE;
-    }
-
-  if (test->kind != XPR_PREOP)
-    return FALSE;
-      
-  tok = (exprData_getUopTok (test->edata));
-  if (!lltok_isMult (tok) )
-    {
-      return FALSE;
-    }
-
-  /* should check preop too */
-  if (inc->kind != XPR_POSTOP)
-    {
-      return FALSE;
-    }
-  
-  tok = (exprData_getUopTok (inc->edata));
-  if (lltok_isInc_Op (tok) )
-      {
-       t1 = exprData_getUopNode (test->edata);
-       t2 = exprData_getUopNode (inc->edata);
-       llassert(exprNode_isDefined(t2) && exprNode_isDefined(t2)  );
-
-       if (exprNode_isUndefined(t1) || exprNode_isUndefined(t2)  )
-         {
-           return FALSE;
-         }
-
-       if (sRef_sameName (t1->sref, t2->sref) )
-         {
-           return TRUE;
-         }
-      }
-  return FALSE;
-}
-
-static /*@only@*/ constraintList getLessThanConstraints (/*@observer@*/ constraintList c)
-{
-  constraintList ret;
-
-  ret = constraintList_makeNew();
-  constraintList_elements (c, el)
-    {
-      llassert(constraint_isDefined(el));
-      if ( constraint_isUndefined(el)  )
-       continue;
-      
-      if (el->ar == LT || el->ar == LTE)
-       {
-         constraint temp;
-         temp = constraint_copy(el);
-
-         ret = constraintList_add (ret, temp);
-       }
-    }
-  end_constraintList_elements;
-
-  return ret;
-}
-
-static /*@only@*/ constraintList getIncConstraints (/*@observer@*/ constraintList c)
-{
-  constraintList ret;
-
-  ret = constraintList_makeNew();
-  constraintList_elements (c, el)
-    {
-      llassert (constraint_isDefined (el));
-
-      if (incVar (el) )
-       {
-         constraint temp;
-         temp = constraint_copy(el);
-         ret = constraintList_add (ret, temp);
-       }
-    }
-  end_constraintList_elements;
-  
-  return ret;
-}
-
-static /*@only@*/ constraintExpr getForTimes (/*@notnull@*/ exprNode forPred, /*@notnull@*/ exprNode forBody)
-{
-  
-  exprNode init, test, inc, t1, t2;
-  constraintList ltCon;
-  constraintList incCon;
-  constraintExpr ret;
-  
-  lltok tok;
-  
-  init  =  exprData_getTripleInit (forPred->edata);
-  test  =  exprData_getTripleTest (forPred->edata);
-  inc   =  exprData_getTripleInc (forPred->edata);
-
-  llassert(exprNode_isDefined(test) );
-  llassert(exprNode_isDefined(inc) );
-  
-  ltCon =  getLessThanConstraints (test->trueEnsuresConstraints);
-  incCon = getIncConstraints (inc->ensuresConstraints);
-  
-  DPRINTF(( message ("getForTimes: ltCon: %s from %s", constraintList_print(ltCon), constraintList_print(test->trueEnsuresConstraints) ) ));
-  
-  DPRINTF(( message ("getForTimes: incCon: %s from %s", constraintList_print(incCon), constraintList_print(inc->ensuresConstraints) ) ));
-   
-  constraintList_elements (ltCon, el) 
-    {
-      constraintList_elements(incCon, el2)
-      {
-       if ( increments(el2, el->lexpr) )
-         {
-           DPRINTF(( message ("getForTimes: %s increments %s", constraint_print(el2), constraint_print(el) ) ));
-           ret =  constraintExpr_copy (el->expr);
-           constraintList_free(ltCon);
-           constraintList_free(incCon);
-           return ret;
-
-         }
-       else
-         DPRINTF(( message ("getForTimes: %s doesn't increment %s", constraint_print(el2), constraint_print(el) )   ));
-      }
-      end_constraintList_elements;
-    }
-
-  end_constraintList_elements;
-
-  constraintList_free(ltCon);
-  constraintList_free(incCon);
-  
-  DPRINTF (( message ("getForTimes: %s  %s resorting to ugly hack", exprNode_unparse(forPred), exprNode_unparse(forBody) ) ));
-  if (! canGetForTimes (forPred, forBody) )
-    {
-      return NULL;
-    }
-
-
-  if (test->kind != XPR_PREOP)
-    llassert (FALSE);
-      
-  tok = (exprData_getUopTok (test->edata));
-  if (!lltok_isMult (tok) )
-    {
-      llassert ( FALSE );
-    }
-
-  /* should check preop too */
-  if (inc->kind != XPR_POSTOP)
-    {
-      llassert (FALSE );
-    }
-  
-  tok = (exprData_getUopTok (inc->edata));
-  if (lltok_isInc_Op (tok) )
-      {
-       t1 = exprData_getUopNode (test->edata);
-       t2 = exprData_getUopNode (inc->edata);
-       if (sRef_sameName (t1->sref, t2->sref) )
-         {
-           return (constraintExpr_makeMaxSetExpr (t1) );
-         }
-      }
-  llassert( FALSE);
-  BADEXIT;
-}
-
-/*@access constraintExpr @*/
-
-static /*@only@*/ constraintExpr constraintExpr_searchAndAdd (/*@only@*/ constraintExpr c, /*@observer@*/ constraintExpr find, /*@observer@*/ constraintExpr add)
-{
-  constraintExprKind kind;
-  constraintExpr temp;
-
-  DPRINTF(( message ("Doing constraintExpr_searchAndAdd  %s %s %s ",
-                    constraintExpr_unparse(c), constraintExpr_unparse(find), constraintExpr_unparse(add) ) ) );
-  
-  if ( constraintExpr_similar (c, find) )
-    {
-
-      constraintExpr newExpr;
-      
-      cstring cPrint;
-      
-      cPrint = constraintExpr_unparse(c);
-      
-      
-      newExpr = constraintExpr_makeAddExpr (c, constraintExpr_copy(add) );
-
-      DPRINTF((message ("Replacing %q with %q",
-                       cPrint, constraintExpr_unparse(newExpr)
-                       )));
-      return newExpr;
-    }
-
-  kind = c->kind;
-  
-  switch (kind)
-    {
-    case term:
-      break;      
-    case unaryExpr:
-      temp = constraintExprData_unaryExprGetExpr (c->data);
-      temp = constraintExpr_searchAndAdd (constraintExpr_copy(temp), find, add);
-      c->data = constraintExprData_unaryExprSetExpr (c->data, temp);
-      break;           
-    case binaryexpr:
-      
-      temp = constraintExprData_binaryExprGetExpr1 (c->data);
-      temp = constraintExpr_searchAndAdd (constraintExpr_copy(temp), find, add);
-      c->data = constraintExprData_binaryExprSetExpr1 (c->data, temp);
-       
-      temp = constraintExprData_binaryExprGetExpr2 (c->data);
-      temp = constraintExpr_searchAndAdd (constraintExpr_copy(temp), find, add);
-      c->data = constraintExprData_binaryExprSetExpr2 (c->data, temp);
-      break;
-    default:
-      llassert(FALSE);
-    }
-  return c;
-  
-}
-
-/*@noaccess constraintExpr @*/
-
-static constraint  constraint_searchAndAdd (/*@returned@*/ constraint c, /*@observer@*/ constraintExpr find, /*@observer@*/ constraintExpr add)
-{
-  
-  llassert (constraint_search (c, find)  );
-  DPRINTF(( message ("Doing constraint_searchAndAdd  %s %s %s ",
-                    constraint_print(c), constraintExpr_unparse(find), constraintExpr_unparse(add) ) ) );
-  
-  c->lexpr = constraintExpr_searchAndAdd (c->lexpr, find, add);
-  c->expr =  constraintExpr_searchAndAdd (c->expr, find, add);
-
-   c = constraint_simplify (c);
-   c = constraint_simplify (c);
-
-  return c;
-  
-}
-
- static constraintList constraintList_searchAndAdd (/*@returned@*/ constraintList list,
-                                                  /*@observer@*/ constraintExpr find, /*@observer@*/ constraintExpr add)
-{
-  constraintList newConstraints;
-  constraintList ret;
-  
-  newConstraints = constraintList_makeNew();
-  
-  constraintList_elements (list, el)
-    {
-      if (constraint_search (el, find) )
-       {
-         constraint newExpr;
-         newExpr = constraint_copy (el);
-
-         newExpr = constraint_searchAndAdd (newExpr, find, add);
-                 DPRINTF (( (message ("Adding constraint %s ", constraint_print (newExpr)) )  ));
-         newConstraints = constraintList_add (newConstraints, newExpr);
-       }
-
-    }
-  end_constraintList_elements;
-  
-  ret =  constraintList_addListFree (list, newConstraints);
-  return ret;
-}
-
-static void doAdjust(/*@unused@*/ exprNode e, /*@unused@*/ exprNode forPred, /*@observer@*/ exprNode forBody, /*@observer@*/ constraintExpr iterations)
-{
-  
-  constraintList_elements (forBody->ensuresConstraints, el)
-    {
-      /* look for var = var + 1 */
-      if (incVar(el) )
-       {
-         DPRINTF((message ("Found inc variable constraint : %s", constraint_print (el) )  ));
-         forBody->requiresConstraints = constraintList_searchAndAdd(forBody->requiresConstraints, el->lexpr, iterations);
-       }
-    }
-  end_constraintList_elements;
-}
-
-void exprNode_forLoopHeuristics( exprNode e, exprNode forPred, exprNode forBody)
-{
-  exprNode init, test, inc;
-
-  constraintExpr iterations;
-  
-  init  =  exprData_getTripleInit (forPred->edata);
-  test =   exprData_getTripleTest (forPred->edata);
-  inc  =   exprData_getTripleInc (forPred->edata);
-
-  if (exprNode_isError (test) || exprNode_isError (inc) )
-    return;
-  
-  iterations = getForTimes (forPred, forBody );
-
-  if (constraintExpr_isDefined (iterations) )
-    {
-      doAdjust ( e, forPred, forBody, iterations);
-      constraintExpr_free(iterations);
-    }
-}
-
-
-/*    else */
-/*      { */
-/*        DPRINTF (("Can't get for time ")); */
-/*      } */
-  
-/*    if (exprNode_isError(init) ) */
-/*      { */
-/*        return; */
-/*      } */
-  
-/*    if (init->kind == XPR_ASSIGN) */
-/*      { */
-/*        t1 = exprData_getOpA (init->edata); */
-/*        t2 = exprData_getOpB (init->edata); */
-      
-/*        if (! (t1->kind == XPR_VAR) ) */
-/*     return; */
-/*      } */
-/*    else */
-/*      return; */
-  
-/*    if (test->kind == XPR_FETCH) */
-/*      { */
-/*        t3 = exprData_getPairA (test->edata); */
-/*        t4 = exprData_getPairB (test->edata); */
-      
-/*        if (sRef_sameName(t1->sref, t4->sref) ) */
-/*     { */
-/*       DPRINTF((message ("Found a for loop matching heuristic:%s", exprNode_unparse (forPred) ) )); */
-/*       con = constraint_makeEnsureLteMaxRead(t1, t3); */
-/*       forPred->ensuresConstraints = constraintList_add(forPred->ensuresConstraints, con);      */
-/*     } */
-/*        else */
-/*     { */
-/*       DPRINTF((message ("Didn't Find a for loop matching heuristic:%s %s and %s differ", exprNode_unparse (forPred), exprNode_unparse(t1), exprNode_unparse(t3) ) )); */
-/*     } */
-/*        return; */
-/*      } */
index 4c3468e1bdf29c16462b5eda07fb2cf834366dac..6b415591a0f95beefb01005ce866c835b0b3ff2a 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
-etags *.y Headers/* *.c  *.l  *.i || etags *.y Headers/* *.c  *.l  *.i;
+etags *.y Headers/* *.c  *.l  *.i || echo "Error creating TAGS file (ignoring)"
 
This page took 0.103228 seconds and 5 git commands to generate.