- Use correct header for SCEV inside LoopPass.cpp
authorAnton Korobeynikov <asl@math.spbu.ru>
Mon, 20 Aug 2007 21:17:26 +0000 (21:17 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Mon, 20 Aug 2007 21:17:26 +0000 (21:17 +0000)
- Move SCEVExpander::expand() out-of-line workarounding possible toolchain bug

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41197 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ScalarEvolutionExpander.h
lib/Analysis/LoopPass.cpp
lib/Analysis/ScalarEvolutionExpander.cpp

index a5cc7138cacba9bd53dfc722a513e9d3ea0a1a0e..8866de54dfd06efe3aac88d233fc5f1292b7c3e2 100644 (file)
@@ -93,17 +93,8 @@ namespace llvm {
     static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS,
                               Value *RHS, Instruction *&InsertPt);
   protected:
-    Value *expand(SCEV *S) {
-      // Check to see if we already expanded this.
-      std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);
-      if (I != InsertedExpressions.end())
-        return I->second;
-
-      Value *V = visit(S);
-      InsertedExpressions[S] = V;
-      return V;
-    }
-
+    Value *expand(SCEV *S);
+    
     Value *visitConstant(SCEVConstant *S) {
       return S->getValue();
     }
index 21c14c6293ebefe9135acb6cfb4bb0e0887950c4..98e8ee55d38cf8c9aac09d1c03004f8f8ca83926 100644 (file)
@@ -14,7 +14,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/ScalarEvolutionExpander.h"
+#include "llvm/Analysis/ScalarEvolution.h"
 using namespace llvm;
 
 //===----------------------------------------------------------------------===//
index 3e590d68f55eadebe090935570f560dd9b5649ba..e65dac71fcf9515741aca5f49e9dfa9e12eec678 100644 (file)
@@ -207,3 +207,15 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) {
 
   return expand(V);
 }
+
+Value *SCEVExpander::expand(SCEV *S) {
+  // Check to see if we already expanded this.
+  std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);
+  if (I != InsertedExpressions.end())
+    return I->second;
+  
+  Value *V = visit(S);
+  InsertedExpressions[S] = V;
+  return V;
+}
+