[cfe-commits] r82017 - in /cfe/trunk: include/clang/Analysis/PathSensitive/GRExprEngine.h lib/Analysis/GRExprEngine.cpp

Ted Kremenek kremenek at apple.com
Tue Sep 15 23:03:40 PDT 2009


Author: kremenek
Date: Wed Sep 16 01:03:39 2009
New Revision: 82017

URL: http://llvm.org/viewvc/llvm-project?rev=82017&view=rev
Log:
Remove ImplicitBadDivides/ExplicitBadDivides node sets.  This checking is now down by a 'Checker' and not build into GRExprEngine.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
    cfe/trunk/lib/Analysis/GRExprEngine.cpp

Modified: cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h?rev=82017&r1=82016&r2=82017&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Wed Sep 16 01:03:39 2009
@@ -138,16 +138,6 @@
   ///  taking a dereference on an undefined value.
   ErrorNodes UndefDeref;
 
-  /// ImplicitBadDivides - Nodes in the ExplodedGraph that result from
-  ///  evaluating a divide or modulo operation where the denominator
-  ///  MAY be zero.
-  ErrorNodes ImplicitBadDivides;
-
-  /// ExplicitBadDivides - Nodes in the ExplodedGraph that result from
-  ///  evaluating a divide or modulo operation where the denominator
-  ///  MUST be zero or undefined.
-  ErrorNodes ExplicitBadDivides;
-
   /// ImplicitBadSizedVLA - Nodes in the ExplodedGraph that result from
   ///  constructing a zero-sized VLA where the size may be zero.
   ErrorNodes ImplicitBadSizedVLA;
@@ -255,14 +245,6 @@
     return N->isSink() && UndefDeref.count(const_cast<ExplodedNode*>(N)) != 0;
   }
 
-  bool isImplicitBadDivide(const ExplodedNode* N) const {
-    return N->isSink() && ImplicitBadDivides.count(const_cast<ExplodedNode*>(N)) != 0;
-  }
-
-  bool isExplicitBadDivide(const ExplodedNode* N) const {
-    return N->isSink() && ExplicitBadDivides.count(const_cast<ExplodedNode*>(N)) != 0;
-  }
-
   bool isNoReturnCall(const ExplodedNode* N) const {
     return N->isSink() && NoReturnCalls.count(const_cast<ExplodedNode*>(N)) != 0;
   }
@@ -334,24 +316,6 @@
   undef_deref_iterator undef_derefs_begin() { return UndefDeref.begin(); }
   undef_deref_iterator undef_derefs_end() { return UndefDeref.end(); }
 
-  typedef ErrorNodes::iterator bad_divide_iterator;
-
-  bad_divide_iterator explicit_bad_divides_begin() {
-    return ExplicitBadDivides.begin();
-  }
-
-  bad_divide_iterator explicit_bad_divides_end() {
-    return ExplicitBadDivides.end();
-  }
-
-  bad_divide_iterator implicit_bad_divides_begin() {
-    return ImplicitBadDivides.begin();
-  }
-
-  bad_divide_iterator implicit_bad_divides_end() {
-    return ImplicitBadDivides.end();
-  }
-
   typedef ErrorNodes::iterator undef_result_iterator;
   undef_result_iterator undef_results_begin() { return UndefResults.begin(); }
   undef_result_iterator undef_results_end() { return UndefResults.end(); }

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=82017&r1=82016&r2=82017&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Wed Sep 16 01:03:39 2009
@@ -2973,8 +2973,6 @@
         GraphPrintCheckerState->isUndefDeref(N) ||
         GraphPrintCheckerState->isUndefStore(N) ||
         GraphPrintCheckerState->isUndefControlFlow(N) ||
-        GraphPrintCheckerState->isExplicitBadDivide(N) ||
-        GraphPrintCheckerState->isImplicitBadDivide(N) ||
         GraphPrintCheckerState->isUndefResult(N) ||
         GraphPrintCheckerState->isBadCall(N) ||
         GraphPrintCheckerState->isUndefArg(N))
@@ -3042,10 +3040,6 @@
             Out << "\\|Dereference of undefialied value.\\l";
           else if (GraphPrintCheckerState->isUndefStore(N))
             Out << "\\|Store to Undefined Loc.";
-          else if (GraphPrintCheckerState->isExplicitBadDivide(N))
-            Out << "\\|Explicit divide-by zero or undefined value.";
-          else if (GraphPrintCheckerState->isImplicitBadDivide(N))
-            Out << "\\|Implicit divide-by zero or undefined value.";
           else if (GraphPrintCheckerState->isUndefResult(N))
             Out << "\\|Result of operation is undefined.";
           else if (GraphPrintCheckerState->isNoReturnCall(N))





More information about the cfe-commits mailing list