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

Ted Kremenek kremenek at apple.com
Fri Jul 18 08:27:59 PDT 2008


Author: kremenek
Date: Fri Jul 18 10:27:58 2008
New Revision: 53751

URL: http://llvm.org/viewvc/llvm-project?rev=53751&view=rev
Log:
Renamed deterministic EvalBinOp to DetermEvalBinOpNN.  This name mangling is unfortunately needed because virtual methods with the same name can be hidden by subclasses.

Modified:
    cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h
    cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
    cfe/trunk/lib/Analysis/GRSimpleVals.cpp
    cfe/trunk/lib/Analysis/GRSimpleVals.h
    cfe/trunk/lib/Analysis/GRTransferFuncs.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=53751&r1=53750&r2=53751&view=diff

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRExprEngine.h Fri Jul 18 10:27:58 2008
@@ -548,12 +548,13 @@
   }
   
   RVal EvalBinOp(BinaryOperator::Opcode Op, NonLVal L, NonLVal R) {
-    return R.isValid() ? getTF().EvalBinOp(getStateManager(), Op, L, R) : R;
+    return R.isValid() ? getTF().DetermEvalBinOpNN(getStateManager(), Op, L, R)
+                       : R;
   }
 
   RVal EvalBinOp(BinaryOperator::Opcode Op, NonLVal L, RVal R) {
-    return R.isValid() ? getTF().EvalBinOp(getStateManager(), Op, L,
-                                           cast<NonLVal>(R)) : R;
+    return R.isValid() ? getTF().DetermEvalBinOpNN(getStateManager(), Op, L,
+                                                   cast<NonLVal>(R)) : R;
   }
   
   void EvalBinOp(ExplodedNodeSet<ValueState>& Dst, Expr* Ex,
@@ -589,8 +590,8 @@
                                cast<NonLVal>(L));
     }
     else
-      return getTF().EvalBinOp(getStateManager(), Op, cast<NonLVal>(L),
-                               cast<NonLVal>(R));
+      return getTF().DetermEvalBinOpNN(getStateManager(), Op, cast<NonLVal>(L),
+                                       cast<NonLVal>(R));
   }
   
   

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

==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/GRTransferFuncs.h Fri Jul 18 10:27:58 2008
@@ -25,6 +25,19 @@
   class ObjCMessageExpr;
   
 class GRTransferFuncs {
+  
+  friend class GRExprEngine;
+  
+protected:
+  
+  
+  virtual RVal DetermEvalBinOpNN(ValueStateManager& StateMgr,
+                                 BinaryOperator::Opcode Op,
+                                 NonLVal L, NonLVal R) {
+    return UnknownVal();
+  }
+  
+  
 public:
   GRTransferFuncs() {}
   virtual ~GRTransferFuncs() {}
@@ -47,12 +60,6 @@
   virtual RVal EvalComplement(GRExprEngine& Engine, NonLVal X) = 0;
 
   // Binary Operators.
-  
-  virtual RVal EvalBinOp(ValueStateManager& StateMgr, BinaryOperator::Opcode Op,
-                         NonLVal L, NonLVal R) {
-    return UnknownVal();
-  }
-  
   virtual void EvalBinOpNN(ValueStateSet& OStates, ValueStateManager& StateMgr,
                            const ValueState* St, Expr* Ex,
                            BinaryOperator::Opcode Op, NonLVal L, NonLVal R);

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.cpp (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.cpp Fri Jul 18 10:27:58 2008
@@ -450,8 +450,9 @@
 
 // Binary operators.
 
-RVal GRSimpleVals::EvalBinOp(ValueStateManager& StateMgr,
-                             BinaryOperator::Opcode Op, NonLVal L, NonLVal R)  {
+RVal GRSimpleVals::DetermEvalBinOpNN(ValueStateManager& StateMgr,
+                                     BinaryOperator::Opcode Op,
+                                     NonLVal L, NonLVal R)  {
   
   BasicValueFactory& BasicVals = StateMgr.getBasicVals();
   

Modified: cfe/trunk/lib/Analysis/GRSimpleVals.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRSimpleVals.h?rev=53751&r1=53750&r2=53751&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRSimpleVals.h (original)
+++ cfe/trunk/lib/Analysis/GRSimpleVals.h Fri Jul 18 10:27:58 2008
@@ -25,6 +25,12 @@
 class ASTContext;
   
 class GRSimpleVals : public GRTransferFuncs {
+protected:
+  
+  virtual RVal DetermEvalBinOpNN(ValueStateManager& StateMgr,
+                                 BinaryOperator::Opcode Op,
+                                 NonLVal L, NonLVal R);
+  
 public:
   GRSimpleVals() {}
   virtual ~GRSimpleVals() {}
@@ -44,9 +50,6 @@
   
   // Binary Operators.
   
-  virtual RVal EvalBinOp(ValueStateManager& StateMgr, BinaryOperator::Opcode Op,
-                         NonLVal L, NonLVal R);
-  
   virtual RVal EvalBinOp(GRExprEngine& Engine, BinaryOperator::Opcode Op,
                          LVal L, LVal R);
   

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

==============================================================================
--- cfe/trunk/lib/Analysis/GRTransferFuncs.cpp (original)
+++ cfe/trunk/lib/Analysis/GRTransferFuncs.cpp Fri Jul 18 10:27:58 2008
@@ -44,5 +44,5 @@
                                   BinaryOperator::Opcode Op,
                                   NonLVal L, NonLVal R) {
   
-  OStates.Add(StateMgr.SetRVal(St, Ex, EvalBinOp(StateMgr, Op, L, R)));
+  OStates.Add(StateMgr.SetRVal(St, Ex, DetermEvalBinOpNN(StateMgr, Op, L, R)));
 }





More information about the cfe-commits mailing list