Android support for SafeStack.
[oota-llvm.git] / include / llvm / Analysis / CFG.h
index e5683c8e59533e56bd229055ae89232c9f04bb1f..7c4df780198cb26468ef36ef5549c942ecfa27ac 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 {
 
@@ -65,8 +65,8 @@ bool isCriticalEdge(const TerminatorInst *TI, unsigned SuccNum,
 /// on branchy code but not loops, and LI is most useful on code with loops but
 /// does not help on branchy code outside loops.
 bool isPotentiallyReachable(const Instruction *From, const Instruction *To,
-                            const DominatorTree *DT = 0,
-                            const LoopInfo *LI = 0);
+                            const DominatorTree *DT = nullptr,
+                            const LoopInfo *LI = nullptr);
 
 /// \brief Determine whether block 'To' is reachable from 'From', returning
 /// true if uncertain.
@@ -75,9 +75,20 @@ bool isPotentiallyReachable(const Instruction *From, const Instruction *To,
 /// Returns false only if we can prove that once 'From' has been reached then
 /// 'To' can not be executed. Conservatively returns true.
 bool isPotentiallyReachable(const BasicBlock *From, const BasicBlock *To,
-                            const DominatorTree *DT = 0,
-                            const LoopInfo *LI = 0);
+                            const DominatorTree *DT = nullptr,
+                            const LoopInfo *LI = nullptr);
 
+/// \brief Determine whether there is at least one path from a block in
+/// 'Worklist' to 'StopBB', returning true if uncertain.
+///
+/// Determine whether there is a path from at least one block in Worklist to
+/// StopBB within a single function. Returns false only if we can prove that
+/// once any block in 'Worklist' has been reached then 'StopBB' can not be
+/// executed. Conservatively returns true.
+bool isPotentiallyReachableFromMany(SmallVectorImpl<BasicBlock *> &Worklist,
+                                    BasicBlock *StopBB,
+                                    const DominatorTree *DT = nullptr,
+                                    const LoopInfo *LI = nullptr);
 } // End llvm namespace
 
 #endif