]> granicus.if.org Git - clang/commitdiff
Rename: CheckBadDiv->CheckDivZero.
authorZhongxing Xu <xuzhongxing@gmail.com>
Thu, 22 Oct 2009 01:58:10 +0000 (01:58 +0000)
committerZhongxing Xu <xuzhongxing@gmail.com>
Thu, 22 Oct 2009 01:58:10 +0000 (01:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84824 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/GRExprEngineInternalChecks.cpp

index cc1ec4b77e48f630e54850a769d3b5c1e64a9567..da24192c9d5a61e72f357ad4a778f7af4c686881 100644 (file)
@@ -742,11 +742,11 @@ void CheckBadCall::PreVisitCallExpr(CheckerContext &C, const CallExpr *CE) {
   }
 }
 
-class VISIBILITY_HIDDEN CheckBadDiv : public CheckerVisitor<CheckBadDiv> {
+class VISIBILITY_HIDDEN CheckDivZero : public CheckerVisitor<CheckDivZero> {
   DivZero *BT;
 public:
-  CheckBadDiv() : BT(0) {}
-  ~CheckBadDiv() {}
+  CheckDivZero() : BT(0) {}
+  ~CheckDivZero() {}
 
   const void *getTag() {
     static int x;
@@ -756,8 +756,8 @@ public:
   void PreVisitBinaryOperator(CheckerContext &C, const BinaryOperator *B);
 };
 
-void CheckBadDiv::PreVisitBinaryOperator(CheckerContext &C,
-                                         const BinaryOperator *B) {
+void CheckDivZero::PreVisitBinaryOperator(CheckerContext &C,
+                                          const BinaryOperator *B) {
   BinaryOperator::Opcode Op = B->getOpcode();
   if (Op != BinaryOperator::Div &&
       Op != BinaryOperator::Rem &&
@@ -792,7 +792,8 @@ void CheckBadDiv::PreVisitBinaryOperator(CheckerContext &C,
     return;
   }
 
-  // If we get here, then the denom should not be zero.
+  // If we get here, then the denom should not be zero. We abandon the implicit
+  // zero denom case for now.
   if (stateNotZero != C.getState())
     C.addTransition(C.GenerateNode(B, stateNotZero));
 }
@@ -828,5 +829,5 @@ void GRExprEngine::RegisterInternalChecks() {
   registerCheck(new CheckAttrNonNull());
   registerCheck(new CheckUndefinedArg());
   registerCheck(new CheckBadCall());
-  registerCheck(new CheckBadDiv());
+  registerCheck(new CheckDivZero());
 }