Make headers standalone, move a virtual method out of line.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 14 Nov 2011 17:22:45 +0000 (17:22 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 14 Nov 2011 17:22:45 +0000 (17:22 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144536 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Transforms/Utils/SSAUpdater.h
include/llvm/Transforms/Utils/SSAUpdaterImpl.h
include/llvm/Transforms/Utils/SimplifyIndVar.h
lib/Transforms/Utils/SSAUpdater.cpp

index 064e5501a455bc6886f7a612b57dbe404665b71d..4c821491b210aaad2d773767aaf6862f1d8e0fd6 100644 (file)
 #ifndef LLVM_TRANSFORMS_UTILS_SSAUPDATER_H
 #define LLVM_TRANSFORMS_UTILS_SSAUPDATER_H
 
+#include "llvm/ADT/StringRef.h"
+
 namespace llvm {
-  class Value;
   class BasicBlock;
-  class Use;
-  class PHINode;
+  class Instruction;
+  class LoadInst;
   template<typename T> class SmallVectorImpl;
   template<typename T> class SSAUpdaterTraits;
-  class DbgDeclareInst;
-  class DIBuilder;
-  class BumpPtrAllocator;
+  class PHINode;
+  class Type;
+  class Use;
+  class Value;
 
 /// SSAUpdater - This class updates SSA form for a set of values defined in
 /// multiple blocks.  This is used when code duplication or another unstructured
@@ -137,12 +139,7 @@ public:
   /// passed into the run method).  Clients should implement this with a more
   /// efficient version if possible.
   virtual bool isInstInList(Instruction *I,
-                            const SmallVectorImpl<Instruction*> &Insts) const {
-    for (unsigned i = 0, e = Insts.size(); i != e; ++i)
-      if (Insts[i] == I)
-        return true;
-    return false;
-  }
+                            const SmallVectorImpl<Instruction*> &Insts) const;
   
   /// doExtraRewritesBeforeFinalDeletion - This hook is invoked after all the
   /// stores are found and inserted as available values, but 
index 5a03d224ff7cb492e661845ecba7eaccffdeaacc..15d65bcf8c6d7299e0e07b3ed95cd7686a37bbf1 100644 (file)
 #ifndef LLVM_TRANSFORMS_UTILS_SSAUPDATERIMPL_H
 #define LLVM_TRANSFORMS_UTILS_SSAUPDATERIMPL_H
 
+#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SmallVector.h"
+#include "llvm/Support/Allocator.h"
+#include "llvm/Support/Debug.h"
+#include "llvm/Support/ValueHandle.h"
+
 namespace llvm {
 
+class CastInst;
+class PHINode;
 template<typename T> class SSAUpdaterTraits;
 
 template<typename UpdaterT>
index 524cf5ad9793dd8282d400d64a0149350c85538b..21d433aa4298e5a05168ed4e48984a0ceafaa797 100644 (file)
 #define LLVM_TRANSFORMS_UTILS_SIMPLIFYINDVAR_H
 
 #include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ValueHandle.h"
 
 namespace llvm {
 
 extern cl::opt<bool> DisableIVRewrite;
 
+class CastInst;
+class IVUsers;
 class Loop;
-class LoopInfo;
-class DominatorTree;
-class ScalarEvolution;
 class LPPassManager;
-class IVUsers;
+class PHINode;
+class ScalarEvolution;
 
 /// Interface for visiting interesting IV users that are recognized but not
 /// simplified by this utility.
index fa8061c2b44c6b7d57a6e9ce164072da002997c7..e60a41b786a78cf4453e166357e6505c1fb08274 100644 (file)
@@ -518,3 +518,10 @@ run(const SmallVectorImpl<Instruction*> &Insts) const {
     User->eraseFromParent();
   }
 }
+
+bool
+LoadAndStorePromoter::isInstInList(Instruction *I,
+                                   const SmallVectorImpl<Instruction*> &Insts)
+                                   const {
+  return std::find(Insts.begin(), Insts.end(), I) != Insts.end();
+}