[Modules] Move CFG.h to the IR library as it defines graph traits over
authorChandler Carruth <chandlerc@gmail.com>
Tue, 4 Mar 2014 11:45:46 +0000 (11:45 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Tue, 4 Mar 2014 11:45:46 +0000 (11:45 +0000)
IR types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@202827 91177308-0d34-0410-b5e6-96231b3b80d8

54 files changed:
include/llvm/Analysis/BranchProbabilityInfo.h
include/llvm/Analysis/CFG.h
include/llvm/Analysis/CFGPrinter.h
include/llvm/Analysis/IntervalIterator.h
include/llvm/Analysis/LoopInfo.h
include/llvm/Analysis/RegionIterator.h
include/llvm/IR/CFG.h [new file with mode: 0644]
include/llvm/IR/Dominators.h
include/llvm/Support/CFG.h [deleted file]
include/llvm/Support/GenericDomTree.h
include/llvm/Support/PredIteratorCache.h
include/llvm/Transforms/Utils/BasicBlockUtils.h
lib/Analysis/BlockFrequencyInfo.cpp
lib/Analysis/BranchProbabilityInfo.cpp
lib/Analysis/Interval.cpp
lib/Analysis/LazyValueInfo.cpp
lib/Analysis/LoopInfo.cpp
lib/Analysis/PostDominators.cpp
lib/CodeGen/UnreachableBlockElim.cpp
lib/IR/AsmWriter.cpp
lib/IR/AutoUpgrade.cpp
lib/IR/BasicBlock.cpp
lib/IR/Dominators.cpp
lib/IR/Verifier.cpp
lib/Target/Mips/Mips16ISelDAGToDAG.cpp
lib/Target/Mips/MipsISelDAGToDAG.cpp
lib/Target/Mips/MipsSEISelDAGToDAG.cpp
lib/Transforms/IPO/ArgumentPromotion.cpp
lib/Transforms/IPO/PartialInlining.cpp
lib/Transforms/IPO/PruneEH.cpp
lib/Transforms/InstCombine/InstructionCombining.cpp
lib/Transforms/ObjCARC/DependencyAnalysis.cpp
lib/Transforms/ObjCARC/ObjCARCOpts.cpp
lib/Transforms/Scalar/ADCE.cpp
lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
lib/Transforms/Scalar/FlattenCFGPass.cpp
lib/Transforms/Scalar/IndVarSimplify.cpp
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/LoopRotation.cpp
lib/Transforms/Scalar/Reassociate.cpp
lib/Transforms/Scalar/Reg2Mem.cpp
lib/Transforms/Scalar/SimplifyCFGPass.cpp
lib/Transforms/Scalar/Sink.cpp
lib/Transforms/Scalar/TailRecursionElimination.cpp
lib/Transforms/Utils/BreakCriticalEdges.cpp
lib/Transforms/Utils/CloneFunction.cpp
lib/Transforms/Utils/Local.cpp
lib/Transforms/Utils/LoopSimplify.cpp
lib/Transforms/Utils/PromoteMemoryToRegister.cpp
lib/Transforms/Utils/SSAUpdater.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
tools/bugpoint/CrashDebugger.cpp
tools/llvm-diff/DifferenceEngine.cpp
tools/opt/PrintSCC.cpp

index 88270c013b0096992faeec69f36e20185b7a6e53..1516894a9e749f8a731fd3981cdaf554e4312c9a 100644 (file)
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/InitializePasses.h"
 #include "llvm/Pass.h"
 #include "llvm/Support/BranchProbability.h"
-#include "llvm/Support/CFG.h"
 
 namespace llvm {
 class LoopInfo;
index e5683c8e59533e56bd229055ae89232c9f04bb1f..02e3b45e9aa3885a094e5deb9ff49d85afcab88a 100644 (file)
@@ -16,7 +16,7 @@
 #define LLVM_ANALYSIS_CFG_H
 
 #include "llvm/IR/BasicBlock.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
 
 namespace llvm {
 
index 8208b63368dafdbff0bbe2f2c89a4741a4bd6d3c..e6d2ed1a68647383b916174e0b6d6d29008aaec2 100644 (file)
 #ifndef LLVM_ANALYSIS_CFGPRINTER_H
 #define LLVM_ANALYSIS_CFGPRINTER_H
 
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/GraphWriter.h"
 
 namespace llvm {
index 22067c4f3c825107153bb96807d278b53cb52a71..73aff76efe83720e7a0c8beabe26d711f8dad6e8 100644 (file)
@@ -34,8 +34,8 @@
 #define LLVM_ANALYSIS_INTERVALITERATOR_H
 
 #include "llvm/Analysis/IntervalPartition.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Function.h"
-#include "llvm/Support/CFG.h"
 #include <algorithm>
 #include <set>
 #include <vector>
index 4f85931521ddafb8a39d2f46c88778489f50bf21..52c832f7eaf7c5769a690332537786c40073e237 100644 (file)
@@ -35,9 +35,9 @@
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include <algorithm>
 
 namespace llvm {
index 8fd42637276e7a7a6cea37b4fac6b4e6c19087d8..ab4d0e0fcc017c375cecd0fbf74166b0984947d5 100644 (file)
@@ -15,7 +15,7 @@
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/Analysis/RegionInfo.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/Support/raw_ostream.h"
 
 namespace llvm {
diff --git a/include/llvm/IR/CFG.h b/include/llvm/IR/CFG.h
new file mode 100644 (file)
index 0000000..a7ff4ae
--- /dev/null
@@ -0,0 +1,383 @@
+//===- CFG.h - Process LLVM structures as graphs ----------------*- C++ -*-===//
+//
+//                     The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines specializations of GraphTraits that allow Function and
+// BasicBlock graphs to be treated as proper graphs for generic algorithms.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_IR_CFG_H
+#define LLVM_IR_CFG_H
+
+#include "llvm/ADT/GraphTraits.h"
+#include "llvm/IR/Function.h"
+#include "llvm/IR/InstrTypes.h"
+
+namespace llvm {
+
+//===----------------------------------------------------------------------===//
+// BasicBlock pred_iterator definition
+//===----------------------------------------------------------------------===//
+
+template <class Ptr, class USE_iterator> // Predecessor Iterator
+class PredIterator : public std::iterator<std::forward_iterator_tag,
+                                          Ptr, ptrdiff_t, Ptr*, Ptr*> {
+  typedef std::iterator<std::forward_iterator_tag, Ptr, ptrdiff_t, Ptr*,
+                                                                    Ptr*> super;
+  typedef PredIterator<Ptr, USE_iterator> Self;
+  USE_iterator It;
+
+  inline void advancePastNonTerminators() {
+    // Loop to ignore non-terminator uses (for example BlockAddresses).
+    while (!It.atEnd() && !isa<TerminatorInst>(*It))
+      ++It;
+  }
+
+public:
+  typedef typename super::pointer pointer;
+  typedef typename super::reference reference;
+
+  PredIterator() {}
+  explicit inline PredIterator(Ptr *bb) : It(bb->use_begin()) {
+    advancePastNonTerminators();
+  }
+  inline PredIterator(Ptr *bb, bool) : It(bb->use_end()) {}
+
+  inline bool operator==(const Self& x) const { return It == x.It; }
+  inline bool operator!=(const Self& x) const { return !operator==(x); }
+
+  inline reference operator*() const {
+    assert(!It.atEnd() && "pred_iterator out of range!");
+    return cast<TerminatorInst>(*It)->getParent();
+  }
+  inline pointer *operator->() const { return &operator*(); }
+
+  inline Self& operator++() {   // Preincrement
+    assert(!It.atEnd() && "pred_iterator out of range!");
+    ++It; advancePastNonTerminators();
+    return *this;
+  }
+
+  inline Self operator++(int) { // Postincrement
+    Self tmp = *this; ++*this; return tmp;
+  }
+
+  /// getOperandNo - Return the operand number in the predecessor's
+  /// terminator of the successor.
+  unsigned getOperandNo() const {
+    return It.getOperandNo();
+  }
+
+  /// getUse - Return the operand Use in the predecessor's terminator
+  /// of the successor.
+  Use &getUse() const {
+    return It.getUse();
+  }
+};
+
+typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
+typedef PredIterator<const BasicBlock,
+                     Value::const_use_iterator> const_pred_iterator;
+
+inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
+inline const_pred_iterator pred_begin(const BasicBlock *BB) {
+  return const_pred_iterator(BB);
+}
+inline pred_iterator pred_end(BasicBlock *BB) { return pred_iterator(BB, true);}
+inline const_pred_iterator pred_end(const BasicBlock *BB) {
+  return const_pred_iterator(BB, true);
+}
+
+
+
+//===----------------------------------------------------------------------===//
+// BasicBlock succ_iterator definition
+//===----------------------------------------------------------------------===//
+
+template <class Term_, class BB_>           // Successor Iterator
+class SuccIterator : public std::iterator<std::random_access_iterator_tag, BB_,
+                                          int, BB_ *, BB_ *> {
+  typedef std::iterator<std::random_access_iterator_tag, BB_, int, BB_ *, BB_ *>
+  super;
+
+public:
+  typedef typename super::pointer pointer;
+  typedef typename super::reference reference;
+
+private:
+  const Term_ Term;
+  unsigned idx;
+  typedef SuccIterator<Term_, BB_> Self;
+
+  inline bool index_is_valid(int idx) {
+    return idx >= 0 && (unsigned) idx < Term->getNumSuccessors();
+  }
+
+  /// \brief Proxy object to allow write access in operator[]
+  class SuccessorProxy {
+    Self it;
+
+  public:
+    explicit SuccessorProxy(const Self &it) : it(it) {}
+
+    SuccessorProxy &operator=(SuccessorProxy r) {
+      *this = reference(r);
+      return *this;
+    }
+
+    SuccessorProxy &operator=(reference r) {
+      it.Term->setSuccessor(it.idx, r);
+      return *this;
+    }
+
+    operator reference() const { return *it; }
+  };
+
+public:
+  explicit inline SuccIterator(Term_ T) : Term(T), idx(0) {// begin iterator
+  }
+  inline SuccIterator(Term_ T, bool)                       // end iterator
+    : Term(T) {
+    if (Term)
+      idx = Term->getNumSuccessors();
+    else
+      // Term == NULL happens, if a basic block is not fully constructed and
+      // consequently getTerminator() returns NULL. In this case we construct a
+      // SuccIterator which describes a basic block that has zero successors.
+      // Defining SuccIterator for incomplete and malformed CFGs is especially
+      // useful for debugging.
+      idx = 0;
+  }
+
+  inline const Self &operator=(const Self &I) {
+    assert(Term == I.Term &&"Cannot assign iterators to two different blocks!");
+    idx = I.idx;
+    return *this;
+  }
+
+  /// getSuccessorIndex - This is used to interface between code that wants to
+  /// operate on terminator instructions directly.
+  unsigned getSuccessorIndex() const { return idx; }
+
+  inline bool operator==(const Self& x) const { return idx == x.idx; }
+  inline bool operator!=(const Self& x) const { return !operator==(x); }
+
+  inline reference operator*() const { return Term->getSuccessor(idx); }
+  inline pointer operator->() const { return operator*(); }
+
+  inline Self& operator++() { ++idx; return *this; } // Preincrement
+
+  inline Self operator++(int) { // Postincrement
+    Self tmp = *this; ++*this; return tmp;
+  }
+
+  inline Self& operator--() { --idx; return *this; }  // Predecrement
+  inline Self operator--(int) { // Postdecrement
+    Self tmp = *this; --*this; return tmp;
+  }
+
+  inline bool operator<(const Self& x) const {
+    assert(Term == x.Term && "Cannot compare iterators of different blocks!");
+    return idx < x.idx;
+  }
+
+  inline bool operator<=(const Self& x) const {
+    assert(Term == x.Term && "Cannot compare iterators of different blocks!");
+    return idx <= x.idx;
+  }
+  inline bool operator>=(const Self& x) const {
+    assert(Term == x.Term && "Cannot compare iterators of different blocks!");
+    return idx >= x.idx;
+  }
+
+  inline bool operator>(const Self& x) const {
+    assert(Term == x.Term && "Cannot compare iterators of different blocks!");
+    return idx > x.idx;
+  }
+
+  inline Self& operator+=(int Right) {
+    unsigned new_idx = idx + Right;
+    assert(index_is_valid(new_idx) && "Iterator index out of bound");
+    idx = new_idx;
+    return *this;
+  }
+
+  inline Self operator+(int Right) const {
+    Self tmp = *this;
+    tmp += Right;
+    return tmp;
+  }
+
+  inline Self& operator-=(int Right) {
+    return operator+=(-Right);
+  }
+
+  inline Self operator-(int Right) const {
+    return operator+(-Right);
+  }
+
+  inline int operator-(const Self& x) const {
+    assert(Term == x.Term && "Cannot work on iterators of different blocks!");
+    int distance = idx - x.idx;
+    return distance;
+  }
+
+  inline SuccessorProxy operator[](int offset) {
+   Self tmp = *this;
+   tmp += offset;
+   return SuccessorProxy(tmp);
+  }
+
+  /// Get the source BB of this iterator.
+  inline BB_ *getSource() {
+    assert(Term && "Source not available, if basic block was malformed");
+    return Term->getParent();
+  }
+};
+
+typedef SuccIterator<TerminatorInst*, BasicBlock> succ_iterator;
+typedef SuccIterator<const TerminatorInst*,
+                     const BasicBlock> succ_const_iterator;
+
+inline succ_iterator succ_begin(BasicBlock *BB) {
+  return succ_iterator(BB->getTerminator());
+}
+inline succ_const_iterator succ_begin(const BasicBlock *BB) {
+  return succ_const_iterator(BB->getTerminator());
+}
+inline succ_iterator succ_end(BasicBlock *BB) {
+  return succ_iterator(BB->getTerminator(), true);
+}
+inline succ_const_iterator succ_end(const BasicBlock *BB) {
+  return succ_const_iterator(BB->getTerminator(), true);
+}
+
+template <typename T, typename U> struct isPodLike<SuccIterator<T, U> > {
+  static const bool value = isPodLike<T>::value;
+};
+
+
+
+//===--------------------------------------------------------------------===//
+// GraphTraits specializations for basic block graphs (CFGs)
+//===--------------------------------------------------------------------===//
+
+// Provide specializations of GraphTraits to be able to treat a function as a
+// graph of basic blocks...
+
+template <> struct GraphTraits<BasicBlock*> {
+  typedef BasicBlock NodeType;
+  typedef succ_iterator ChildIteratorType;
+
+  static NodeType *getEntryNode(BasicBlock *BB) { return BB; }
+  static inline ChildIteratorType child_begin(NodeType *N) {
+    return succ_begin(N);
+  }
+  static inline ChildIteratorType child_end(NodeType *N) {
+    return succ_end(N);
+  }
+};
+
+template <> struct GraphTraits<const BasicBlock*> {
+  typedef const BasicBlock NodeType;
+  typedef succ_const_iterator ChildIteratorType;
+
+  static NodeType *getEntryNode(const BasicBlock *BB) { return BB; }
+
+  static inline ChildIteratorType child_begin(NodeType *N) {
+    return succ_begin(N);
+  }
+  static inline ChildIteratorType child_end(NodeType *N) {
+    return succ_end(N);
+  }
+};
+
+// Provide specializations of GraphTraits to be able to treat a function as a
+// graph of basic blocks... and to walk it in inverse order.  Inverse order for
+// a function is considered to be when traversing the predecessor edges of a BB
+// instead of the successor edges.
+//
+template <> struct GraphTraits<Inverse<BasicBlock*> > {
+  typedef BasicBlock NodeType;
+  typedef pred_iterator ChildIteratorType;
+  static NodeType *getEntryNode(Inverse<BasicBlock *> G) { return G.Graph; }
+  static inline ChildIteratorType child_begin(NodeType *N) {
+    return pred_begin(N);
+  }
+  static inline ChildIteratorType child_end(NodeType *N) {
+    return pred_end(N);
+  }
+};
+
+template <> struct GraphTraits<Inverse<const BasicBlock*> > {
+  typedef const BasicBlock NodeType;
+  typedef const_pred_iterator ChildIteratorType;
+  static NodeType *getEntryNode(Inverse<const BasicBlock*> G) {
+    return G.Graph;
+  }
+  static inline ChildIteratorType child_begin(NodeType *N) {
+    return pred_begin(N);
+  }
+  static inline ChildIteratorType child_end(NodeType *N) {
+    return pred_end(N);
+  }
+};
+
+
+
+//===--------------------------------------------------------------------===//
+// GraphTraits specializations for function basic block graphs (CFGs)
+//===--------------------------------------------------------------------===//
+
+// Provide specializations of GraphTraits to be able to treat a function as a
+// graph of basic blocks... these are the same as the basic block iterators,
+// except that the root node is implicitly the first node of the function.
+//
+template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
+  static NodeType *getEntryNode(Function *F) { return &F->getEntryBlock(); }
+
+  // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
+  typedef Function::iterator nodes_iterator;
+  static nodes_iterator nodes_begin(Function *F) { return F->begin(); }
+  static nodes_iterator nodes_end  (Function *F) { return F->end(); }
+  static size_t         size       (Function *F) { return F->size(); }
+};
+template <> struct GraphTraits<const Function*> :
+  public GraphTraits<const BasicBlock*> {
+  static NodeType *getEntryNode(const Function *F) {return &F->getEntryBlock();}
+
+  // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
+  typedef Function::const_iterator nodes_iterator;
+  static nodes_iterator nodes_begin(const Function *F) { return F->begin(); }
+  static nodes_iterator nodes_end  (const Function *F) { return F->end(); }
+  static size_t         size       (const Function *F) { return F->size(); }
+};
+
+
+// Provide specializations of GraphTraits to be able to treat a function as a
+// graph of basic blocks... and to walk it in inverse order.  Inverse order for
+// a function is considered to be when traversing the predecessor edges of a BB
+// instead of the successor edges.
+//
+template <> struct GraphTraits<Inverse<Function*> > :
+  public GraphTraits<Inverse<BasicBlock*> > {
+  static NodeType *getEntryNode(Inverse<Function*> G) {
+    return &G.Graph->getEntryBlock();
+  }
+};
+template <> struct GraphTraits<Inverse<const Function*> > :
+  public GraphTraits<Inverse<const BasicBlock*> > {
+  static NodeType *getEntryNode(Inverse<const Function *> G) {
+    return &G.Graph->getEntryBlock();
+  }
+};
+
+} // End llvm namespace
+
+#endif
index a4302f126cc86d211c2c515fc686c9a99e842b03..550b634a24fd2887c7ceef3e043afddb24935e7b 100644 (file)
@@ -21,9 +21,9 @@
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/IR/BasicBlock.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Function.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/GenericDomTree.h"
 #include "llvm/Support/raw_ostream.h"
diff --git a/include/llvm/Support/CFG.h b/include/llvm/Support/CFG.h
deleted file mode 100644 (file)
index 572ab05..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-//===-- llvm/Support/CFG.h - Process LLVM structures as graphs --*- C++ -*-===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines specializations of GraphTraits that allow Function and
-// BasicBlock graphs to be treated as proper graphs for generic algorithms.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_CFG_H
-#define LLVM_SUPPORT_CFG_H
-
-#include "llvm/ADT/GraphTraits.h"
-#include "llvm/IR/Function.h"
-#include "llvm/IR/InstrTypes.h"
-
-namespace llvm {
-
-//===----------------------------------------------------------------------===//
-// BasicBlock pred_iterator definition
-//===----------------------------------------------------------------------===//
-
-template <class Ptr, class USE_iterator> // Predecessor Iterator
-class PredIterator : public std::iterator<std::forward_iterator_tag,
-                                          Ptr, ptrdiff_t, Ptr*, Ptr*> {
-  typedef std::iterator<std::forward_iterator_tag, Ptr, ptrdiff_t, Ptr*,
-                                                                    Ptr*> super;
-  typedef PredIterator<Ptr, USE_iterator> Self;
-  USE_iterator It;
-
-  inline void advancePastNonTerminators() {
-    // Loop to ignore non-terminator uses (for example BlockAddresses).
-    while (!It.atEnd() && !isa<TerminatorInst>(*It))
-      ++It;
-  }
-
-public:
-  typedef typename super::pointer pointer;
-  typedef typename super::reference reference;
-
-  PredIterator() {}
-  explicit inline PredIterator(Ptr *bb) : It(bb->use_begin()) {
-    advancePastNonTerminators();
-  }
-  inline PredIterator(Ptr *bb, bool) : It(bb->use_end()) {}
-
-  inline bool operator==(const Self& x) const { return It == x.It; }
-  inline bool operator!=(const Self& x) const { return !operator==(x); }
-
-  inline reference operator*() const {
-    assert(!It.atEnd() && "pred_iterator out of range!");
-    return cast<TerminatorInst>(*It)->getParent();
-  }
-  inline pointer *operator->() const { return &operator*(); }
-
-  inline Self& operator++() {   // Preincrement
-    assert(!It.atEnd() && "pred_iterator out of range!");
-    ++It; advancePastNonTerminators();
-    return *this;
-  }
-
-  inline Self operator++(int) { // Postincrement
-    Self tmp = *this; ++*this; return tmp;
-  }
-
-  /// getOperandNo - Return the operand number in the predecessor's
-  /// terminator of the successor.
-  unsigned getOperandNo() const {
-    return It.getOperandNo();
-  }
-
-  /// getUse - Return the operand Use in the predecessor's terminator
-  /// of the successor.
-  Use &getUse() const {
-    return It.getUse();
-  }
-};
-
-typedef PredIterator<BasicBlock, Value::use_iterator> pred_iterator;
-typedef PredIterator<const BasicBlock,
-                     Value::const_use_iterator> const_pred_iterator;
-
-inline pred_iterator pred_begin(BasicBlock *BB) { return pred_iterator(BB); }
-inline const_pred_iterator pred_begin(const BasicBlock *BB) {
-  return const_pred_iterator(BB);
-}
-inline pred_iterator pred_end(BasicBlock *BB) { return pred_iterator(BB, true);}
-inline const_pred_iterator pred_end(const BasicBlock *BB) {
-  return const_pred_iterator(BB, true);
-}
-
-
-
-//===----------------------------------------------------------------------===//
-// BasicBlock succ_iterator definition
-//===----------------------------------------------------------------------===//
-
-template <class Term_, class BB_>           // Successor Iterator
-class SuccIterator : public std::iterator<std::random_access_iterator_tag, BB_,
-                                          int, BB_ *, BB_ *> {
-  typedef std::iterator<std::random_access_iterator_tag, BB_, int, BB_ *, BB_ *>
-  super;
-
-public:
-  typedef typename super::pointer pointer;
-  typedef typename super::reference reference;
-
-private:
-  const Term_ Term;
-  unsigned idx;
-  typedef SuccIterator<Term_, BB_> Self;
-
-  inline bool index_is_valid(int idx) {
-    return idx >= 0 && (unsigned) idx < Term->getNumSuccessors();
-  }
-
-  /// \brief Proxy object to allow write access in operator[]
-  class SuccessorProxy {
-    Self it;
-
-  public:
-    explicit SuccessorProxy(const Self &it) : it(it) {}
-
-    SuccessorProxy &operator=(SuccessorProxy r) {
-      *this = reference(r);
-      return *this;
-    }
-
-    SuccessorProxy &operator=(reference r) {
-      it.Term->setSuccessor(it.idx, r);
-      return *this;
-    }
-
-    operator reference() const { return *it; }
-  };
-
-public:
-  explicit inline SuccIterator(Term_ T) : Term(T), idx(0) {// begin iterator
-  }
-  inline SuccIterator(Term_ T, bool)                       // end iterator
-    : Term(T) {
-    if (Term)
-      idx = Term->getNumSuccessors();
-    else
-      // Term == NULL happens, if a basic block is not fully constructed and
-      // consequently getTerminator() returns NULL. In this case we construct a
-      // SuccIterator which describes a basic block that has zero successors.
-      // Defining SuccIterator for incomplete and malformed CFGs is especially
-      // useful for debugging.
-      idx = 0;
-  }
-
-  inline const Self &operator=(const Self &I) {
-    assert(Term == I.Term &&"Cannot assign iterators to two different blocks!");
-    idx = I.idx;
-    return *this;
-  }
-
-  /// getSuccessorIndex - This is used to interface between code that wants to
-  /// operate on terminator instructions directly.
-  unsigned getSuccessorIndex() const { return idx; }
-
-  inline bool operator==(const Self& x) const { return idx == x.idx; }
-  inline bool operator!=(const Self& x) const { return !operator==(x); }
-
-  inline reference operator*() const { return Term->getSuccessor(idx); }
-  inline pointer operator->() const { return operator*(); }
-
-  inline Self& operator++() { ++idx; return *this; } // Preincrement
-
-  inline Self operator++(int) { // Postincrement
-    Self tmp = *this; ++*this; return tmp;
-  }
-
-  inline Self& operator--() { --idx; return *this; }  // Predecrement
-  inline Self operator--(int) { // Postdecrement
-    Self tmp = *this; --*this; return tmp;
-  }
-
-  inline bool operator<(const Self& x) const {
-    assert(Term == x.Term && "Cannot compare iterators of different blocks!");
-    return idx < x.idx;
-  }
-
-  inline bool operator<=(const Self& x) const {
-    assert(Term == x.Term && "Cannot compare iterators of different blocks!");
-    return idx <= x.idx;
-  }
-  inline bool operator>=(const Self& x) const {
-    assert(Term == x.Term && "Cannot compare iterators of different blocks!");
-    return idx >= x.idx;
-  }
-
-  inline bool operator>(const Self& x) const {
-    assert(Term == x.Term && "Cannot compare iterators of different blocks!");
-    return idx > x.idx;
-  }
-
-  inline Self& operator+=(int Right) {
-    unsigned new_idx = idx + Right;
-    assert(index_is_valid(new_idx) && "Iterator index out of bound");
-    idx = new_idx;
-    return *this;
-  }
-
-  inline Self operator+(int Right) const {
-    Self tmp = *this;
-    tmp += Right;
-    return tmp;
-  }
-
-  inline Self& operator-=(int Right) {
-    return operator+=(-Right);
-  }
-
-  inline Self operator-(int Right) const {
-    return operator+(-Right);
-  }
-
-  inline int operator-(const Self& x) const {
-    assert(Term == x.Term && "Cannot work on iterators of different blocks!");
-    int distance = idx - x.idx;
-    return distance;
-  }
-
-  inline SuccessorProxy operator[](int offset) {
-   Self tmp = *this;
-   tmp += offset;
-   return SuccessorProxy(tmp);
-  }
-
-  /// Get the source BB of this iterator.
-  inline BB_ *getSource() {
-    assert(Term && "Source not available, if basic block was malformed");
-    return Term->getParent();
-  }
-};
-
-typedef SuccIterator<TerminatorInst*, BasicBlock> succ_iterator;
-typedef SuccIterator<const TerminatorInst*,
-                     const BasicBlock> succ_const_iterator;
-
-inline succ_iterator succ_begin(BasicBlock *BB) {
-  return succ_iterator(BB->getTerminator());
-}
-inline succ_const_iterator succ_begin(const BasicBlock *BB) {
-  return succ_const_iterator(BB->getTerminator());
-}
-inline succ_iterator succ_end(BasicBlock *BB) {
-  return succ_iterator(BB->getTerminator(), true);
-}
-inline succ_const_iterator succ_end(const BasicBlock *BB) {
-  return succ_const_iterator(BB->getTerminator(), true);
-}
-
-template <typename T, typename U> struct isPodLike<SuccIterator<T, U> > {
-  static const bool value = isPodLike<T>::value;
-};
-
-
-
-//===--------------------------------------------------------------------===//
-// GraphTraits specializations for basic block graphs (CFGs)
-//===--------------------------------------------------------------------===//
-
-// Provide specializations of GraphTraits to be able to treat a function as a
-// graph of basic blocks...
-
-template <> struct GraphTraits<BasicBlock*> {
-  typedef BasicBlock NodeType;
-  typedef succ_iterator ChildIteratorType;
-
-  static NodeType *getEntryNode(BasicBlock *BB) { return BB; }
-  static inline ChildIteratorType child_begin(NodeType *N) {
-    return succ_begin(N);
-  }
-  static inline ChildIteratorType child_end(NodeType *N) {
-    return succ_end(N);
-  }
-};
-
-template <> struct GraphTraits<const BasicBlock*> {
-  typedef const BasicBlock NodeType;
-  typedef succ_const_iterator ChildIteratorType;
-
-  static NodeType *getEntryNode(const BasicBlock *BB) { return BB; }
-
-  static inline ChildIteratorType child_begin(NodeType *N) {
-    return succ_begin(N);
-  }
-  static inline ChildIteratorType child_end(NodeType *N) {
-    return succ_end(N);
-  }
-};
-
-// Provide specializations of GraphTraits to be able to treat a function as a
-// graph of basic blocks... and to walk it in inverse order.  Inverse order for
-// a function is considered to be when traversing the predecessor edges of a BB
-// instead of the successor edges.
-//
-template <> struct GraphTraits<Inverse<BasicBlock*> > {
-  typedef BasicBlock NodeType;
-  typedef pred_iterator ChildIteratorType;
-  static NodeType *getEntryNode(Inverse<BasicBlock *> G) { return G.Graph; }
-  static inline ChildIteratorType child_begin(NodeType *N) {
-    return pred_begin(N);
-  }
-  static inline ChildIteratorType child_end(NodeType *N) {
-    return pred_end(N);
-  }
-};
-
-template <> struct GraphTraits<Inverse<const BasicBlock*> > {
-  typedef const BasicBlock NodeType;
-  typedef const_pred_iterator ChildIteratorType;
-  static NodeType *getEntryNode(Inverse<const BasicBlock*> G) {
-    return G.Graph;
-  }
-  static inline ChildIteratorType child_begin(NodeType *N) {
-    return pred_begin(N);
-  }
-  static inline ChildIteratorType child_end(NodeType *N) {
-    return pred_end(N);
-  }
-};
-
-
-
-//===--------------------------------------------------------------------===//
-// GraphTraits specializations for function basic block graphs (CFGs)
-//===--------------------------------------------------------------------===//
-
-// Provide specializations of GraphTraits to be able to treat a function as a
-// graph of basic blocks... these are the same as the basic block iterators,
-// except that the root node is implicitly the first node of the function.
-//
-template <> struct GraphTraits<Function*> : public GraphTraits<BasicBlock*> {
-  static NodeType *getEntryNode(Function *F) { return &F->getEntryBlock(); }
-
-  // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
-  typedef Function::iterator nodes_iterator;
-  static nodes_iterator nodes_begin(Function *F) { return F->begin(); }
-  static nodes_iterator nodes_end  (Function *F) { return F->end(); }
-  static size_t         size       (Function *F) { return F->size(); }
-};
-template <> struct GraphTraits<const Function*> :
-  public GraphTraits<const BasicBlock*> {
-  static NodeType *getEntryNode(const Function *F) {return &F->getEntryBlock();}
-
-  // nodes_iterator/begin/end - Allow iteration over all nodes in the graph
-  typedef Function::const_iterator nodes_iterator;
-  static nodes_iterator nodes_begin(const Function *F) { return F->begin(); }
-  static nodes_iterator nodes_end  (const Function *F) { return F->end(); }
-  static size_t         size       (const Function *F) { return F->size(); }
-};
-
-
-// Provide specializations of GraphTraits to be able to treat a function as a
-// graph of basic blocks... and to walk it in inverse order.  Inverse order for
-// a function is considered to be when traversing the predecessor edges of a BB
-// instead of the successor edges.
-//
-template <> struct GraphTraits<Inverse<Function*> > :
-  public GraphTraits<Inverse<BasicBlock*> > {
-  static NodeType *getEntryNode(Inverse<Function*> G) {
-    return &G.Graph->getEntryBlock();
-  }
-};
-template <> struct GraphTraits<Inverse<const Function*> > :
-  public GraphTraits<Inverse<const BasicBlock*> > {
-  static NodeType *getEntryNode(Inverse<const Function *> G) {
-    return &G.Graph->getEntryBlock();
-  }
-};
-
-} // End llvm namespace
-
-#endif
index 5c22aa3ff2c4782d3d171eb8a49afca401cdac5d..a4c6c8fd298f4aa2ebdc887e1cae4e8017374b44 100644 (file)
@@ -23,7 +23,7 @@
 #include "llvm/ADT/GraphTraits.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
index c5fb78050106a6216ae3e69940c55d4870112386..3fa056edb60c0a66031c0d4e45c332fffe48610d 100644 (file)
@@ -13,8 +13,8 @@
 
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/Support/Allocator.h"
-#include "llvm/Support/CFG.h"
 
 #ifndef LLVM_SUPPORT_PREDITERATORCACHE_H
 #define LLVM_SUPPORT_PREDITERATORCACHE_H
index cab0d5f29c2b658f609e1fe1e2f998514fca863c..95d08a4d661cb99501738ef5d2f9ddbae965818d 100644 (file)
@@ -18,7 +18,7 @@
 // FIXME: Move to this file: BasicBlock::removePredecessor, BB::splitBasicBlock
 
 #include "llvm/IR/BasicBlock.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
 
 namespace llvm {
 
index 0088c20745574ec42d845ade70647167217ffedf..e52a0f8a8ee6be499cd17511805670ed57c1e70a 100644 (file)
@@ -16,8 +16,8 @@
 #include "llvm/Analysis/BranchProbabilityInfo.h"
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Analysis/Passes.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/InitializePasses.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/GraphWriter.h"
index 15491f072cc8f08eaca447e8d07922fb8f9a0cb3..b901c546270a8e161c7cf8033cd345e2d6c39dab 100644 (file)
 #include "llvm/Analysis/BranchProbabilityInfo.h"
 #include "llvm/ADT/PostOrderIterator.h"
 #include "llvm/Analysis/LoopInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Metadata.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 
 using namespace llvm;
index 26a0322407ec541176205f3f697d2606dcea13bf..e3e785ffc45fb3d15950b9e347da31c13eb95390 100644 (file)
@@ -14,7 +14,7 @@
 
 #include "llvm/Analysis/Interval.h"
 #include "llvm/IR/BasicBlock.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/Support/raw_ostream.h"
 #include <algorithm>
 
index b68b3869e70695bfe3acc9957eed98d5989ee939..5fd003eba67cba660a46c6a88cbf3f6567dcdf37 100644 (file)
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/Analysis/ConstantFolding.h"
 #include "llvm/Analysis/ValueTracking.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/PatternMatch.h"
 #include "llvm/IR/ValueHandle.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/ConstantRange.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
index aae4d640339ff59b46b43329f078323ed670bc64..47132165e99983f0750011d45066b410a975fa54 100644 (file)
 #include "llvm/Analysis/LoopInfoImpl.h"
 #include "llvm/Analysis/LoopIterator.h"
 #include "llvm/Analysis/ValueTracking.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Metadata.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include <algorithm>
index 28969878a13bc2efc14c7f15b137c61390606350..f23833a95415775efe150d8f195e7bc9edc31c0d 100644 (file)
@@ -16,8 +16,8 @@
 #include "llvm/Analysis/PostDominators.h"
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/SetOperations.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Instructions.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/GenericDomTreeConstruction.h"
 using namespace llvm;
index bfbbe57976d066de07aabd90f5910aafc0962ae1..4036fccbb49955deffb001945d76fbbed4a1e310 100644 (file)
 #include "llvm/CodeGen/MachineLoopInfo.h"
 #include "llvm/CodeGen/MachineModuleInfo.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constant.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Type.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Target/TargetInstrInfo.h"
 using namespace llvm;
 
index d414f764d334dd320bc89b5ed3a725f6fa3a910f..eb932ec51f08530c8ebb2b861649dca99142e896 100644 (file)
@@ -21,6 +21,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/DebugInfo.h"
 #include "llvm/IR/AssemblyAnnotationWriter.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/CallingConv.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DerivedTypes.h"
@@ -32,7 +33,6 @@
 #include "llvm/IR/Operator.h"
 #include "llvm/IR/TypeFinder.h"
 #include "llvm/IR/ValueSymbolTable.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Dwarf.h"
 #include "llvm/Support/ErrorHandling.h"
index dd72e42adb1cd956159a806b5c4abe344390b870..637c9b1b05f0466652504dab4ca124d0c0fea897 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "llvm/AutoUpgrade.h"
 #include "llvm/DebugInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/CallSite.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DiagnosticInfo.h"
@@ -22,7 +23,6 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/ErrorHandling.h"
 #include <cstring>
 using namespace llvm;
index 125b20615bd1af69252c51894eeca081a62958c2..1b1236bd686a649a00b30840313cca1b34879f4d 100644 (file)
 #include "llvm/IR/BasicBlock.h"
 #include "SymbolTableListTraitsImpl.h"
 #include "llvm/ADT/STLExtras.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Type.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/LeakDetector.h"
 #include <algorithm>
 using namespace llvm;
index 84cd86bf49a19a19e8c3138858d5a66ada9a1822..d6649d6c7064bcc862abb2878b26ca524585da30 100644 (file)
@@ -18,8 +18,8 @@
 #include "llvm/ADT/DepthFirstIterator.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/SmallVector.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Instructions.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Debug.h"
index bb0ac014cab1679ffc85a14f5b8e00002e492bef..4adbf6c547ae77c8813cb2dd733776359132a2ff 100644 (file)
@@ -52,6 +52,7 @@
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/DebugInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/CallSite.h"
 #include "llvm/IR/CallingConv.h"
 #include "llvm/IR/Constants.h"
@@ -66,7 +67,6 @@
 #include "llvm/IR/PassManager.h"
 #include "llvm/InstVisitor.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ConstantRange.h"
 #include "llvm/Support/Debug.h"
index c1ecb235f7855bce12749ef6e2f85b48cf08aebd..9e36546c7aa70662085090641d2cc89fdfa6968d 100644 (file)
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Type.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
index fcf29fd9b8d2ef086f7848783f5ed12a28aa4e3e..941aeac811b73d3959abf56cfa9fdedd51265b35 100644 (file)
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Type.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
index aac58ab0d049a9ce617ac0b8e6903ea80c4dc0bf..61dc454a0e0004fbbf22e052181e91faee485ead 100644 (file)
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/CodeGen/MachineRegisterInfo.h"
 #include "llvm/CodeGen/SelectionDAGNodes.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/GlobalValue.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Intrinsics.h"
 #include "llvm/IR/Type.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
index d7f8424dfe069ac792e96b2b4e358d0fa19eb871..e1eb3048460dc1900d748438d79e0304f0545182 100644 (file)
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Analysis/CallGraph.h"
 #include "llvm/Analysis/CallGraphSCCPass.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/CallSite.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include <set>
index 93e0912f472f5e7a05d5848990cd40b8b584bd59..672b5621dfe5978ac28cf9fe851ce35fc90790e4 100644 (file)
 #define DEBUG_TYPE "partialinlining"
 #include "llvm/Transforms/IPO.h"
 #include "llvm/ADT/Statistic.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Transforms/Utils/Cloning.h"
 #include "llvm/Transforms/Utils/CodeExtractor.h"
 using namespace llvm;
index cba6ae052b82dca8839e6e7c6e4bc5398a7a2648..a85194923de7c67d8ad432767f9551c5ea618050 100644 (file)
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Analysis/CallGraph.h"
 #include "llvm/Analysis/CallGraphSCCPass.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/LLVMContext.h"
-#include "llvm/Support/CFG.h"
 #include <algorithm>
 using namespace llvm;
 
index b960d47b62cf22e1ce79d9151f0ea144621b78f6..f2e80636cc50046959b20cc834b85b1dfe62b11d 100644 (file)
 #include "llvm/Analysis/ConstantFolding.h"
 #include "llvm/Analysis/InstructionSimplify.h"
 #include "llvm/Analysis/MemoryBuiltins.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/GetElementPtrTypeIterator.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/PatternMatch.h"
 #include "llvm/IR/ValueHandle.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Target/TargetLibraryInfo.h"
index 8f917aeb3725f0948b42dbc9bd7b9775f53f4685..8780359b26aff7e41f98c2bdcef7d16053cb279f 100644 (file)
@@ -24,7 +24,7 @@
 #include "ObjCARC.h"
 #include "DependencyAnalysis.h"
 #include "ProvenanceAnalysis.h"
-#include "llvm/Support/CFG.h"
+#include "llvm/IR/CFG.h"
 
 using namespace llvm;
 using namespace llvm::objcarc;
index 95f01802e8671091fdaa015eb7b99d9cbed67d64..b5ef1c9cd680d3be92500b67b29b2e950761fc16 100644 (file)
@@ -35,9 +35,9 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/ADT/Statistic.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/IR/LLVMContext.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 
index 1f4dd9fa5f6567874a5218e9a790b40d41afc1f0..2baf873ad8bb2471d46f16681e5bb78ac01181f8 100644 (file)
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/IR/BasicBlock.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/InstIterator.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 using namespace llvm;
 
 STATISTIC(NumRemoved, "Number of instructions removed");
index 7615e8f17b6ce8405130121320b405e478df25d0..e417c3002f017b6f8e6d942779a421c3b0d41305 100644 (file)
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Analysis/InstructionSimplify.h"
 #include "llvm/Analysis/LazyValueInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Utils/Local.h"
index e7de07f246dba27f65cc477a58219f5e8bcbb001..1fa41ec5c2260e8e9a361724d1a56384f854afa1 100644 (file)
@@ -14,8 +14,8 @@
 #define DEBUG_TYPE "flattencfg"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Analysis/AliasAnalysis.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Transforms/Utils/Local.h"
 using namespace llvm;
 
index 5f7a5caa23f0cc73a9a19544c8acea7bcca18c8a..4a7f30a782208265adbcff32e0d9f7ea13747423 100644 (file)
@@ -33,6 +33,7 @@
 #include "llvm/Analysis/LoopPass.h"
 #include "llvm/Analysis/ScalarEvolutionExpander.h"
 #include "llvm/IR/BasicBlock.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/Dominators.h"
@@ -40,7 +41,6 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Type.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
index 96d30430bf3c54e7a5ed63dc354df941b57df0fb..5f3a68222b44c22d7a3b4b39795e8b59aaa9a57b 100644 (file)
@@ -40,6 +40,7 @@
 #include "llvm/Analysis/LoopPass.h"
 #include "llvm/Analysis/ScalarEvolution.h"
 #include "llvm/Analysis/ValueTracking.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DerivedTypes.h"
@@ -48,7 +49,6 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Metadata.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/PredIteratorCache.h"
index 04c3b9877b477fa432da1f3939cc8c7bc10f2485..4691bc519da53bd8b019e147c28f2321fc9c5162 100644 (file)
 #include "llvm/Analysis/ScalarEvolution.h"
 #include "llvm/Analysis/TargetTransformInfo.h"
 #include "llvm/Analysis/ValueTracking.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/IntrinsicInst.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Utils/Local.h"
index 99b55058b71cc29b21052a9655f3a0db68ba9a77..695e73393ab7f765656317b0f3452568f4551908 100644 (file)
@@ -27,6 +27,7 @@
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/Statistic.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Function.h"
@@ -35,7 +36,6 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Utils/Local.h"
index 07f540a30127c4dbad9fd2d41998a38acd35fea3..2e75a835429f10a46414c02788c685fe45d6015f 100644 (file)
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/IR/BasicBlock.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Transforms/Utils/Local.h"
 #include <list>
 using namespace llvm;
index b925cd235c97d14961af6fbe0da54b34c4ffcda6..a655bb5ab30882f36707c658ae99b4445fbff92e 100644 (file)
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Analysis/TargetTransformInfo.h"
 #include "llvm/IR/Attributes.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Transforms/Utils/Local.h"
 using namespace llvm;
 
index e500c3b24e71434bb00620d954df68d154b50b16..287bd5b7d617ffd7926ddd8f61e8a1b4d3a8653c 100644 (file)
@@ -18,9 +18,9 @@
 #include "llvm/Analysis/AliasAnalysis.h"
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Analysis/ValueTracking.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/IntrinsicInst.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;
index ad92a5961432e5f63888255f429258ef02f6fbec..5efa30c0f0e08b8b366e635f608ae2a16ca7e1a6 100644 (file)
@@ -60,6 +60,7 @@
 #include "llvm/Analysis/InstructionSimplify.h"
 #include "llvm/Analysis/Loads.h"
 #include "llvm/Analysis/TargetTransformInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/CallSite.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DerivedTypes.h"
@@ -69,7 +70,6 @@
 #include "llvm/IR/Module.h"
 #include "llvm/IR/ValueHandle.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
index 0939252f5cc988885241963ab8e0ea3adb9bd077..61f184449444b994a15de645ed63142b21c7a902 100644 (file)
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Analysis/CFG.h"
 #include "llvm/Analysis/LoopInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Type.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 using namespace llvm;
index 32da80be65d51e1c5d11fecc91b33f93540f524b..4d81a820728cb680dca85ff0292b494ffca835a8 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/Analysis/ConstantFolding.h"
 #include "llvm/Analysis/InstructionSimplify.h"
 #include "llvm/DebugInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Function.h"
@@ -26,7 +27,6 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Metadata.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Utils/Local.h"
 #include "llvm/Transforms/Utils/ValueMapper.h"
index f437be6270013458001d9c6d77cc80d56a16bfeb..0b0410455a38a3e98fc24d153c83ce709409b3c7 100644 (file)
@@ -22,6 +22,7 @@
 #include "llvm/Analysis/ValueTracking.h"
 #include "llvm/DIBuilder.h"
 #include "llvm/DebugInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DerivedTypes.h"
@@ -37,7 +38,6 @@
 #include "llvm/IR/Metadata.h"
 #include "llvm/IR/Operator.h"
 #include "llvm/IR/ValueHandle.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/MathExtras.h"
 #include "llvm/Support/raw_ostream.h"
index 15500e6eb48e2f4332571e9a02b13ae1592a9cb3..f49854f71da53de5ffa02b9aadb77c1f4b57dcc9 100644 (file)
@@ -49,6 +49,7 @@
 #include "llvm/Analysis/InstructionSimplify.h"
 #include "llvm/Analysis/LoopInfo.h"
 #include "llvm/Analysis/ScalarEvolution.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/Function.h"
@@ -56,7 +57,6 @@
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Type.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
 #include "llvm/Transforms/Utils/Local.h"
index 8ed3b16c87293f2f2318b29f1e5d2f3b19a2ebcc..430ac2da4ff52beb7afd967f6235dc9c99c8f68b 100644 (file)
@@ -38,6 +38,7 @@
 #include "llvm/Analysis/ValueTracking.h"
 #include "llvm/DIBuilder.h"
 #include "llvm/DebugInfo.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Dominators.h"
@@ -45,7 +46,6 @@
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/IntrinsicInst.h"
 #include "llvm/IR/Metadata.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Transforms/Utils/Local.h"
 #include <algorithm>
 #include <queue>
index 415e615e7851116e1af6369022f800c3d53853ea..28f5c44a9a9095103584daee0d3d8a8f99abf2cd 100644 (file)
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/TinyPtrVector.h"
 #include "llvm/Analysis/InstructionSimplify.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/IntrinsicInst.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
index a7018b17e85350cc4c465d9585c07a917212d523..f33a1a7ec6da9b7f46a69962a67136f5f14b31b9 100644 (file)
@@ -23,6 +23,7 @@
 #include "llvm/Analysis/InstructionSimplify.h"
 #include "llvm/Analysis/TargetTransformInfo.h"
 #include "llvm/Analysis/ValueTracking.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/DerivedTypes.h"
@@ -37,7 +38,6 @@
 #include "llvm/IR/Operator.h"
 #include "llvm/IR/PatternMatch.h"
 #include "llvm/IR/Type.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/ConstantRange.h"
 #include "llvm/Support/Debug.h"
index fa1c82f01d66aabc44525083b0fda1e3bcb7c1b9..39180304795ddaeb2d241d83c3330f86d8885f58 100644 (file)
@@ -15,6 +15,7 @@
 #include "ListReducer.h"
 #include "ToolRunner.h"
 #include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/DerivedTypes.h"
 #include "llvm/IR/Instructions.h"
@@ -23,7 +24,6 @@
 #include "llvm/IR/Verifier.h"
 #include "llvm/Pass.h"
 #include "llvm/PassManager.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/FileUtilities.h"
 #include "llvm/Transforms/Scalar.h"
index 03404bbb2282d16327b16942ba45e3027fcd8de7..7d379ef5dc41cf7048da7ec15cde97220e4dc051 100644 (file)
 #include "llvm/ADT/SmallVector.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/ADT/StringSet.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/CallSite.h"
 #include "llvm/IR/Constants.h"
 #include "llvm/IR/Function.h"
 #include "llvm/IR/Instructions.h"
 #include "llvm/IR/Module.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/ErrorHandling.h"
 #include "llvm/Support/raw_ostream.h"
 #include "llvm/Support/type_traits.h"
index 00282140730f1322a3c05ed485cbd2e471c53a01..f2e77f0cef778c1b533e7ee61a7b098318b3c59a 100644 (file)
@@ -27,9 +27,9 @@
 
 #include "llvm/ADT/SCCIterator.h"
 #include "llvm/Analysis/CallGraph.h"
+#include "llvm/IR/CFG.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Pass.h"
-#include "llvm/Support/CFG.h"
 #include "llvm/Support/raw_ostream.h"
 using namespace llvm;