From 03ee68a145ab5394c070298049d93f305be93ec3 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 13 Jul 2009 22:19:41 +0000 Subject: [PATCH] Forward-declare Loop and LoopInfo instead of #including LoopInfo.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75529 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/LoopVR.h | 6 +----- include/llvm/Analysis/ScalarEvolution.h | 7 ++++++- include/llvm/Analysis/ScalarEvolutionExpander.h | 1 + include/llvm/Transforms/Utils/FunctionUtils.h | 2 +- include/llvm/Transforms/Utils/UnrollLoop.h | 4 ++-- lib/Analysis/LoopVR.cpp | 7 +++++++ 6 files changed, 18 insertions(+), 9 deletions(-) diff --git a/include/llvm/Analysis/LoopVR.h b/include/llvm/Analysis/LoopVR.h index be13a80d02a..a9f6636d79b 100644 --- a/include/llvm/Analysis/LoopVR.h +++ b/include/llvm/Analysis/LoopVR.h @@ -36,11 +36,7 @@ public: virtual void print(std::ostream &os, const Module *) const; void releaseMemory(); - void getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequiredTransitive(); - AU.addRequiredTransitive(); - AU.setPreservesAll(); - } + void getAnalysisUsage(AnalysisUsage &AU) const; //===--------------------------------------------------------------------- // Methods that are used to look up and update particular values. diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index e31d63c5a82..b14418a5997 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -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" @@ -30,14 +30,19 @@ #include "llvm/ADT/FoldingSet.h" #include "llvm/ADT/DenseMap.h" #include +#include 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 diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h index e3ff5b4690c..645ce9ecec8 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpander.h +++ b/include/llvm/Analysis/ScalarEvolutionExpander.h @@ -17,6 +17,7 @@ #include "llvm/Analysis/ScalarEvolutionExpressions.h" #include "llvm/Support/IRBuilder.h" #include "llvm/Support/TargetFolder.h" +#include namespace llvm { /// SCEVExpander - This class uses information about analyze scalars to diff --git a/include/llvm/Transforms/Utils/FunctionUtils.h b/include/llvm/Transforms/Utils/FunctionUtils.h index dc7ef238652..785b08f8291 100644 --- a/include/llvm/Transforms/Utils/FunctionUtils.h +++ b/include/llvm/Transforms/Utils/FunctionUtils.h @@ -14,13 +14,13 @@ #ifndef LLVM_TRANSFORMS_UTILS_FUNCTION_H #define LLVM_TRANSFORMS_UTILS_FUNCTION_H -#include "llvm/Analysis/LoopInfo.h" #include namespace llvm { class BasicBlock; class DominatorTree; class Function; + class Loop; /// ExtractCodeRegion - rip out a sequence of basic blocks into a new function /// diff --git a/include/llvm/Transforms/Utils/UnrollLoop.h b/include/llvm/Transforms/Utils/UnrollLoop.h index a9c0bf6968a..3d5ee1a62b8 100644 --- a/include/llvm/Transforms/Utils/UnrollLoop.h +++ b/include/llvm/Transforms/Utils/UnrollLoop.h @@ -16,10 +16,10 @@ #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); diff --git a/lib/Analysis/LoopVR.cpp b/lib/Analysis/LoopVR.cpp index 1c78ef9a52d..6854e950ef8 100644 --- a/lib/Analysis/LoopVR.cpp +++ b/lib/Analysis/LoopVR.cpp @@ -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(); + AU.addRequiredTransitive(); + AU.setPreservesAll(); +} + bool LoopVR::runOnFunction(Function &F) { Map.clear(); return false; } void LoopVR::print(std::ostream &os, const Module *) const {