]> granicus.if.org Git - clang/commitdiff
Move method out-of-line.
authorTed Kremenek <kremenek@apple.com>
Fri, 30 Jan 2009 19:27:39 +0000 (19:27 +0000)
committerTed Kremenek <kremenek@apple.com>
Fri, 30 Jan 2009 19:27:39 +0000 (19:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63412 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Analysis/PathSensitive/GRExprEngine.h
lib/Analysis/GRExprEngine.cpp

index 05bb333cdc5463a1966d0595e106e38dec260a93..d84d17c01715513f223d89dff90ec86196358b59 100644 (file)
@@ -638,36 +638,7 @@ protected:
   void EvalBinOp(GRStateSet& OStates, const GRState* St, Expr* Ex,
                  BinaryOperator::Opcode Op, NonLoc L, NonLoc R);  
   
-  SVal EvalBinOp(BinaryOperator::Opcode Op, SVal L, SVal R) {
-
-    if (L.isUndef() || R.isUndef())
-      return UndefinedVal();
-
-    if (L.isUnknown() || R.isUnknown())
-      return UnknownVal();
-
-    if (isa<Loc>(L)) {
-      if (isa<Loc>(R))
-        return getTF().EvalBinOp(*this, Op, cast<Loc>(L), cast<Loc>(R));
-      else
-        return getTF().EvalBinOp(*this, Op, cast<Loc>(L), cast<NonLoc>(R));
-    }
-
-    if (isa<Loc>(R)) {
-      // Support pointer arithmetic where the increment/decrement operand
-      // is on the left and the pointer on the right.
-
-      assert (Op == BinaryOperator::Add || Op == BinaryOperator::Sub);
-
-      // Commute the operands.
-      return getTF().EvalBinOp(*this, Op, cast<Loc>(R),
-                               cast<NonLoc>(L));
-    }
-    else
-      return getTF().DetermEvalBinOpNN(*this, Op, cast<NonLoc>(L),
-                                       cast<NonLoc>(R));
-  }
-  
+  SVal EvalBinOp(BinaryOperator::Opcode Op, SVal L, SVal R);
   
   void EvalCall(NodeSet& Dst, CallExpr* CE, SVal L, NodeTy* Pred) {
     assert (Builder && "GRStmtNodeBuilder must be defined.");
index d9bdd8be0b69d50a8fcf6d805aeb74d76f209882..5268e1324f5598e3ff516d58ae4617aca9cc6df3 100644 (file)
@@ -2691,6 +2691,36 @@ void GRExprEngine::EvalBinOp(GRStateSet& OStates, const GRState* St,
   if (R.isValid()) getTF().EvalBinOpNN(OStates, *this, St, Ex, Op, L, R);
 }
 
+SVal GRExprEngine::EvalBinOp(BinaryOperator::Opcode Op, SVal L, SVal R) {
+  
+  if (L.isUndef() || R.isUndef())
+    return UndefinedVal();
+  
+  if (L.isUnknown() || R.isUnknown())
+    return UnknownVal();
+  
+  if (isa<Loc>(L)) {
+    if (isa<Loc>(R))
+      return getTF().EvalBinOp(*this, Op, cast<Loc>(L), cast<Loc>(R));
+    else
+      return getTF().EvalBinOp(*this, Op, cast<Loc>(L), cast<NonLoc>(R));
+  }
+  
+  if (isa<Loc>(R)) {
+    // Support pointer arithmetic where the increment/decrement operand
+    // is on the left and the pointer on the right.
+    
+    assert (Op == BinaryOperator::Add || Op == BinaryOperator::Sub);
+    
+    // Commute the operands.
+    return getTF().EvalBinOp(*this, Op, cast<Loc>(R),
+                             cast<NonLoc>(L));
+  }
+  else
+    return getTF().DetermEvalBinOpNN(*this, Op, cast<NonLoc>(L),
+                                     cast<NonLoc>(R));
+}
+
 //===----------------------------------------------------------------------===//
 // Visualization.
 //===----------------------------------------------------------------------===//