From 7a87e8f90b1b1fb190d58088c35bea73b9e03555 Mon Sep 17 00:00:00 2001 From: Florian Hahn Date: Sun, 19 Apr 2020 18:17:20 +0100 Subject: [PATCH] [LoopUtils] Clean up includes, use forward decls if appropriate (NFC). Most of the includes in LoopUtils.h are not required in the header and they can be replaced by forward declarations. Unfortunately includes of TargetTransformInfo.h and IVDescriptors.h pull in a bunch of additional things, but there is no easy way to get rid of them at the moment I think. --- llvm/include/llvm/Transforms/Utils/LoopUtils.h | 22 ++++++++-------------- llvm/lib/Transforms/Utils/LoopUtils.cpp | 7 +++++++ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/llvm/include/llvm/Transforms/Utils/LoopUtils.h b/llvm/include/llvm/Transforms/Utils/LoopUtils.h index 54fc3a7..ba06d63 100644 --- a/llvm/include/llvm/Transforms/Utils/LoopUtils.h +++ b/llvm/include/llvm/Transforms/Utils/LoopUtils.h @@ -13,24 +13,10 @@ #ifndef LLVM_TRANSFORMS_UTILS_LOOPUTILS_H #define LLVM_TRANSFORMS_UTILS_LOOPUTILS_H -#include "llvm/ADT/DenseMap.h" -#include "llvm/ADT/Optional.h" -#include "llvm/ADT/PriorityWorklist.h" -#include "llvm/ADT/SetVector.h" -#include "llvm/ADT/SmallPtrSet.h" -#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringRef.h" #include "llvm/Analysis/AliasAnalysis.h" -#include "llvm/Analysis/EHPersonalities.h" #include "llvm/Analysis/IVDescriptors.h" -#include "llvm/Analysis/LoopPass.h" -#include "llvm/Analysis/MustExecute.h" #include "llvm/Analysis/TargetTransformInfo.h" -#include "llvm/IR/Dominators.h" -#include "llvm/IR/InstrTypes.h" -#include "llvm/IR/Operator.h" -#include "llvm/IR/ValueHandle.h" -#include "llvm/Support/Casting.h" #include "llvm/Transforms/Utils/ValueMapper.h" namespace llvm { @@ -53,6 +39,14 @@ class SCEV; class SCEVExpander; class TargetLibraryInfo; class TargetTransformInfo; +class LPPassManager; +class Instruction; + +template class Optional; +template class SmallSetVector; +template class SmallVector; +template class SmallVectorImpl; +template class SmallPriorityWorklist; BasicBlock *InsertPreheaderForLoop(Loop *L, DominatorTree *DT, LoopInfo *LI, MemorySSAUpdater *MSSAU, bool PreserveLCSSA); diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index add9133..ab0b5a5 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -11,7 +11,13 @@ //===----------------------------------------------------------------------===// #include "llvm/Transforms/Utils/LoopUtils.h" +#include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/Optional.h" +#include "llvm/ADT/PriorityWorklist.h" #include "llvm/ADT/ScopeExit.h" +#include "llvm/ADT/SetVector.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallVector.h" #include "llvm/Analysis/AliasAnalysis.h" #include "llvm/Analysis/BasicAliasAnalysis.h" #include "llvm/Analysis/DomTreeUpdater.h" @@ -34,6 +40,7 @@ #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/MDBuilder.h" #include "llvm/IR/Module.h" +#include "llvm/IR/Operator.h" #include "llvm/IR/PatternMatch.h" #include "llvm/IR/ValueHandle.h" #include "llvm/InitializePasses.h" -- 2.7.4