* Make contained ostream not public.
[oota-llvm.git] / include / llvm / Analysis / ScalarEvolution.h
index 253217ef1a3b4e5e8652d8a769633c2a079e6edf..f3ef0e551d48941a6203eb50773a15d4f622df88 100644 (file)
@@ -31,7 +31,6 @@ namespace llvm {
   class Loop;
   class LoopInfo;
   class SCEVHandle;
-  class ScalarEvolutionRewriter;
 
   /// SCEV - This class represent an analyzed expression in the program.  These
   /// are reference counted opaque objects that the client is not allowed to
@@ -44,14 +43,8 @@ namespace llvm {
     friend class SCEVHandle;
     void addRef() { ++RefCount; }
     void dropRef() {
-      if (--RefCount == 0) {
-#if 0
-        std::cerr << "DELETING: " << this << ": ";
-        print(std::cerr);
-        std::cerr << "\n";
-#endif
+      if (--RefCount == 0)
         delete this;
-      }
     }
 
     SCEV(const SCEV &);            // DO NOT IMPLEMENT
@@ -81,13 +74,6 @@ namespace llvm {
     ///
     virtual const Type *getType() const = 0;
 
-    /// expandCodeFor - Given a rewriter object, expand this SCEV into a closed
-    /// form expression and return a Value corresponding to the expression in
-    /// question.
-    virtual Value *expandCodeFor(ScalarEvolutionRewriter &SER,
-                                 Instruction *InsertPt) = 0;
-
-
     /// print - Print out the internal representation of this scalar to the
     /// specified stream.  This should really only be used for debugging
     /// purposes.
@@ -115,7 +101,6 @@ namespace llvm {
     virtual bool isLoopInvariant(const Loop *L) const;
     virtual const Type *getType() const;
     virtual bool hasComputableLoopEvolution(const Loop *L) const;
-    virtual Value *expandCodeFor(ScalarEvolutionRewriter &, Instruction *);
     virtual void print(std::ostream &OS) const;
 
 
@@ -225,46 +210,6 @@ namespace llvm {
     virtual void getAnalysisUsage(AnalysisUsage &AU) const;
     virtual void print(std::ostream &OS) const;
   };
-
-  /// ScalarEvolutionRewriter - This class uses information about analyze
-  /// scalars to rewrite expressions in canonical form.  This can be used for
-  /// induction variable substitution, strength reduction, or loop exit value
-  /// replacement.
-  ///
-  /// Clients should create an instance of this class when rewriting is needed,
-  /// and destroying it when finished to allow the release of the associated
-  /// memory.
-  class ScalarEvolutionRewriter {
-    ScalarEvolution &SE;
-    LoopInfo &LI;
-    std::map<SCEVHandle, Value*> InsertedExpressions;
-    std::set<Instruction*> InsertedInstructions;
-  public:
-    ScalarEvolutionRewriter(ScalarEvolution &se, LoopInfo &li)
-      : SE(se), LI(li) {}
-
-    /// isInsertedInstruction - Return true if the specified instruction was
-    /// inserted by the code rewriter.  If so, the client should not modify the
-    /// instruction.
-    bool isInsertedInstruction(Instruction *I) const {
-      return InsertedInstructions.count(I);
-    }
-    
-    /// GetOrInsertCanonicalInductionVariable - This method returns the
-    /// canonical induction variable of the specified type for the specified
-    /// loop (inserts one if there is none).  A canonical induction variable
-    /// starts at zero and steps by one on each iteration.
-    Value *GetOrInsertCanonicalInductionVariable(const Loop *L, const Type *Ty);
-
-    /// ExpandCodeFor - Insert code to directly compute the specified SCEV
-    /// expression into the program.  The inserted code is inserted into the
-    /// specified block.
-    ///
-    /// If a particular value sign is required, a type may be specified for the
-    /// result.
-    Value *ExpandCodeFor(SCEVHandle SH, Instruction *InsertPt,
-                         const Type *Ty = 0);
-  };
 }
 
 #endif