[objc-arc] Refactor (Re-)initialization of PtrState from dataflow -> {TopDown,BottomU...
[oota-llvm.git] / lib / Transforms / ObjCARC / PtrState.h
index d49c909fe50c9bb0a2c34db2a94e4bc70d14b94a..299acff884c0fdb400054f83918ddf299651db47 100644 (file)
@@ -17,6 +17,7 @@
 #ifndef LLVM_LIB_TRANSFORMS_OBJCARC_PTRSTATE_H
 #define LLVM_LIB_TRANSFORMS_OBJCARC_PTRSTATE_H
 
+#include "ARCInstKind.h"
 #include "llvm/ADT/SmallPtrSet.h"
 #include "llvm/IR/Instruction.h"
 #include "llvm/IR/Value.h"
@@ -26,6 +27,8 @@
 namespace llvm {
 namespace objcarc {
 
+struct ARCMDKindCache;
+
 /// \enum Sequence
 ///
 /// \brief A sequence of states that a pointer may go through in which an
@@ -160,14 +163,20 @@ public:
   const RRInfo &GetRRInfo() const { return RRI; }
 };
 
-/// This is currently a stub.
 struct BottomUpPtrState : PtrState {
   BottomUpPtrState() : PtrState() {}
+
+  /// (Re-)Initialize this bottom up pointer returning true if we detected a
+  /// pointer with nested releases.
+  bool InitBottomUp(ARCMDKindCache &Cache, Instruction *I);
 };
 
-/// This is currently a stub.
 struct TopDownPtrState : PtrState {
   TopDownPtrState() : PtrState() {}
+
+  /// (Re-)Initialize this bottom up pointer returning true if we detected a
+  /// pointer with nested releases.
+  bool InitTopDown(ARCInstKind Kind, Instruction *I);
 };
 
 } // end namespace objcarc