Make DataLayout Non-Optional in the Module
[oota-llvm.git] / include / llvm / Transforms / Utils / BasicBlockUtils.h
index 6a35aae01e321705f3c9914ff68a292b5707824b..710db03c45d69943316a3e743aceb7acb927b363 100644 (file)
@@ -28,7 +28,6 @@ class DominatorTree;
 class LoopInfo;
 class Instruction;
 class MDNode;
-class Pass;
 class ReturnInst;
 class TargetLibraryInfo;
 class TerminatorInst;
@@ -86,27 +85,23 @@ struct CriticalEdgeSplittingOptions {
   LoopInfo *LI;
   bool MergeIdenticalEdges;
   bool DontDeleteUselessPHIs;
-  bool SplitLandingPads;
   bool PreserveLCSSA;
 
   CriticalEdgeSplittingOptions()
       : AA(nullptr), DT(nullptr), LI(nullptr), MergeIdenticalEdges(false),
-        DontDeleteUselessPHIs(false), SplitLandingPads(false),
-        PreserveLCSSA(false) {}
+        DontDeleteUselessPHIs(false), PreserveLCSSA(false) {}
 
   /// \brief Basic case of setting up all the analysis.
   CriticalEdgeSplittingOptions(AliasAnalysis *AA, DominatorTree *DT = nullptr,
                                LoopInfo *LI = nullptr)
       : AA(AA), DT(DT), LI(LI), MergeIdenticalEdges(false),
-        DontDeleteUselessPHIs(false), SplitLandingPads(false),
-        PreserveLCSSA(false) {}
+        DontDeleteUselessPHIs(false), PreserveLCSSA(false) {}
 
   /// \brief A common pattern is to preserve the dominator tree and loop
   /// info but not care about AA.
   CriticalEdgeSplittingOptions(DominatorTree *DT, LoopInfo *LI)
       : AA(nullptr), DT(DT), LI(LI), MergeIdenticalEdges(false),
-        DontDeleteUselessPHIs(false), SplitLandingPads(false),
-        PreserveLCSSA(false) {}
+        DontDeleteUselessPHIs(false), PreserveLCSSA(false) {}
 
   CriticalEdgeSplittingOptions &setMergeIdenticalEdges() {
     MergeIdenticalEdges = true;
@@ -118,11 +113,6 @@ struct CriticalEdgeSplittingOptions {
     return *this;
   }
 
-  CriticalEdgeSplittingOptions &setSplitLandingPads() {
-    SplitLandingPads = true;
-    return *this;
-  }
-
   CriticalEdgeSplittingOptions &setPreserveLCSSA() {
     PreserveLCSSA = true;
     return *this;
@@ -200,9 +190,9 @@ unsigned SplitAllCriticalEdges(Function &F,
                                const CriticalEdgeSplittingOptions &Options =
                                    CriticalEdgeSplittingOptions());
 
-/// SplitEdge -  Split the edge connecting specified block. Pass P must
-/// not be NULL.
-BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To, Pass *P);
+/// SplitEdge -  Split the edge connecting specified block.
+BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To,
+                      DominatorTree *DT = nullptr, LoopInfo *LI = nullptr);
 
 /// SplitBlock - Split the specified block at the specified instruction - every
 /// thing before SplitPt stays in Old and everything starting with SplitPt moves
@@ -212,11 +202,15 @@ BasicBlock *SplitEdge(BasicBlock *From, BasicBlock *To, Pass *P);
 BasicBlock *SplitBlock(BasicBlock *Old, Instruction *SplitPt,
                        DominatorTree *DT = nullptr, LoopInfo *LI = nullptr);
 
-/// SplitBlockPredecessors - This method transforms BB by introducing a new
-/// basic block into the function, and moving some of the predecessors of BB to
-/// be predecessors of the new block.  The new predecessors are indicated by the
-/// Preds array, which has NumPreds elements in it.  The new block is given a
-/// suffix of 'Suffix'.  This function returns the new block.
+/// SplitBlockPredecessors - This method introduces at least one new basic block
+/// into the function and moves some of the predecessors of BB to be
+/// predecessors of the new block. The new predecessors are indicated by the
+/// Preds array. The new block is given a suffix of 'Suffix'. Returns new basic
+/// block to which predecessors from Preds are now pointing.
+///
+/// If BB is a landingpad block then additional basicblock might be introduced.
+/// It will have Suffix+".split_lp". See SplitLandingPadPredecessors for more
+/// details on this case.
 ///
 /// This currently updates the LLVM IR, AliasAnalysis, DominatorTree,
 /// DominanceFrontier, LoopInfo, and LCCSA but no other analyses.