Factor out a common base class between SCEVCommutativeExpr and
[oota-llvm.git] / lib / Analysis / ScalarEvolution.cpp
index 50cece03657565300f48be20805d24ae4201462d..e00d1d9f80650b6b746886655dff3d31cdb5cc42 100644 (file)
@@ -316,7 +316,7 @@ replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
   return this;
 }
 
-bool SCEVCommutativeExpr::dominates(BasicBlock *BB, DominatorTree *DT) const {
+bool SCEVNAryExpr::dominates(BasicBlock *BB, DominatorTree *DT) const {
   for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
     if (!getOperand(i)->dominates(BB, DT))
       return false;
@@ -359,15 +359,6 @@ SCEVAddRecExpr::~SCEVAddRecExpr() {
   SCEVAddRecExprs->erase(std::make_pair(L, SCEVOps));
 }
 
-bool SCEVAddRecExpr::dominates(BasicBlock *BB, DominatorTree *DT) const {
-  for (unsigned i = 0, e = getNumOperands(); i != e; ++i) {
-    if (!getOperand(i)->dominates(BB, DT))
-      return false;
-  }
-  return true;
-}
-
-
 SCEVHandle SCEVAddRecExpr::
 replaceSymbolicValuesWithConcrete(const SCEVHandle &Sym,
                                   const SCEVHandle &Conc,