Forward-declare Loop and LoopInfo instead of #including LoopInfo.h.
authorDan Gohman <gohman@apple.com>
Mon, 13 Jul 2009 22:19:41 +0000 (22:19 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 13 Jul 2009 22:19:41 +0000 (22:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75529 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/LoopVR.h
include/llvm/Analysis/ScalarEvolution.h
include/llvm/Analysis/ScalarEvolutionExpander.h
include/llvm/Transforms/Utils/FunctionUtils.h
include/llvm/Transforms/Utils/UnrollLoop.h
lib/Analysis/LoopVR.cpp

index be13a80d02abd155108a0b6fab678b107af6a652..a9f6636d79b07440f0aec5069b9dc68ac311683d 100644 (file)
@@ -36,11 +36,7 @@ public:
   virtual void print(std::ostream &os, const Module *) const;
   void releaseMemory();
 
-  void getAnalysisUsage(AnalysisUsage &AU) const {
-    AU.addRequiredTransitive<LoopInfo>();
-    AU.addRequiredTransitive<ScalarEvolution>();
-    AU.setPreservesAll();
-  }
+  void getAnalysisUsage(AnalysisUsage &AU) const;
 
   //===---------------------------------------------------------------------
   // Methods that are used to look up and update particular values.
index e31d63c5a8226433d701f21952263139fce3facc..b14418a59976977855b4f6c47e960316af39432f 100644 (file)
@@ -22,7 +22,7 @@
 #define LLVM_ANALYSIS_SCALAREVOLUTION_H
 
 #include "llvm/Pass.h"
-#include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Instructions.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/ValueHandle.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/ADT/DenseMap.h"
 #include <iosfwd>
+#include <map>
 
 namespace llvm {
   class APInt;
+  class Constant;
   class ConstantInt;
+  class DominatorTree;
   class Type;
   class ScalarEvolution;
   class TargetData;
   class LLVMContext;
+  class Loop;
+  class LoopInfo;
 
   /// SCEV - This class represents an analyzed expression in the program.  These
   /// are opaque objects that the client is not allowed to do much with
index e3ff5b4690cc66f25dbc26f3f4c204f1d92b2ca2..645ce9ecec8b0a2964a1989a38ae776959137a3e 100644 (file)
@@ -17,6 +17,7 @@
 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
 #include "llvm/Support/IRBuilder.h"
 #include "llvm/Support/TargetFolder.h"
+#include <set>
 
 namespace llvm {
   /// SCEVExpander - This class uses information about analyze scalars to
index dc7ef238652c5f2b3adc4d6e5283862eed17be00..785b08f82917da54bacf41c83a1d5eaa7fd77cfc 100644 (file)
 #ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H
 #define LLVM_TRANSFORMS_UTILS_FUNCTION_H
 
-#include "llvm/Analysis/LoopInfo.h"
 #include <vector>
 
 namespace llvm {
   class BasicBlock;
   class DominatorTree;
   class Function;
+  class Loop;
 
   /// ExtractCodeRegion - rip out a sequence of basic blocks into a new function
   ///
index a9c0bf6968a7ab393f41df17715a8df1af8c2922..3d5ee1a62b8a6b5add0aae22140672f051ccc7aa 100644 (file)
 #ifndef LLVM_TRANSFORMS_UTILS_UNROLLLOOP_H
 #define LLVM_TRANSFORMS_UTILS_UNROLLLOOP_H
 
-#include "llvm/Analysis/LoopInfo.h"
-
 namespace llvm {
 
+class Loop;
+class LoopInfo;
 class LPPassManager;
 
 bool UnrollLoop(Loop *L, unsigned Count, LoopInfo* LI, LPPassManager* LPM);
index 1c78ef9a52d1036f217b817a197fdc56d8bc61be..6854e950ef8f083de2c2e6b775a65f771ae105a3 100644 (file)
@@ -16,6 +16,7 @@
 #include "llvm/Constants.h"
 #include "llvm/Instructions.h"
 #include "llvm/LLVMContext.h"
+#include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
 #include "llvm/Assembly/Writer.h"
 #include "llvm/Support/CFG.h"
@@ -220,6 +221,12 @@ ConstantRange LoopVR::getRange(const SCEV *S, const SCEV *T, ScalarEvolution &SE
   return FullSet;
 }
 
+void LoopVR::getAnalysisUsage(AnalysisUsage &AU) const {
+  AU.addRequiredTransitive<LoopInfo>();
+  AU.addRequiredTransitive<ScalarEvolution>();
+  AU.setPreservesAll();
+}
+
 bool LoopVR::runOnFunction(Function &F) { Map.clear(); return false; }
 
 void LoopVR::print(std::ostream &os, const Module *) const {