diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:10:56 +0000 | 
| commit | 044eb2f6afba375a914ac9d8024f8f5142bb912e (patch) | |
| tree | 1475247dc9f9fe5be155ebd4c9069c75aadf8c20 /lib/Transforms/ObjCARC/PtrState.h | |
| parent | eb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (diff) | |
Notes
Diffstat (limited to 'lib/Transforms/ObjCARC/PtrState.h')
| -rw-r--r-- | lib/Transforms/ObjCARC/PtrState.h | 39 | 
1 files changed, 21 insertions, 18 deletions
| diff --git a/lib/Transforms/ObjCARC/PtrState.h b/lib/Transforms/ObjCARC/PtrState.h index 87298fa59bfd..e1e95afcf76b 100644 --- a/lib/Transforms/ObjCARC/PtrState.h +++ b/lib/Transforms/ObjCARC/PtrState.h @@ -1,4 +1,4 @@ -//===--- PtrState.h - ARC State for a Ptr -------------------*- C++ -*-----===// +//===- PtrState.h - ARC State for a Ptr -------------------------*- C++ -*-===//  //  //                     The LLVM Compiler Infrastructure  // @@ -19,12 +19,16 @@  #include "llvm/ADT/SmallPtrSet.h"  #include "llvm/Analysis/ObjCARCInstKind.h" -#include "llvm/IR/Instruction.h" -#include "llvm/IR/Value.h" -#include "llvm/Support/Debug.h" -#include "llvm/Support/raw_ostream.h" +#include "llvm/Support/Compiler.h"  namespace llvm { + +class BasicBlock; +class Instruction; +class MDNode; +class raw_ostream; +class Value; +  namespace objcarc {  class ARCMDKindCache; @@ -63,14 +67,14 @@ struct RRInfo {    /// of any intervening side effects.    ///    /// KnownSafe is true when either of these conditions is satisfied. -  bool KnownSafe; +  bool KnownSafe = false;    /// True of the objc_release calls are all marked with the "tail" keyword. -  bool IsTailCallRelease; +  bool IsTailCallRelease = false;    /// If the Calls are objc_release calls and they all have a    /// clang.imprecise_release tag, this is the metadata tag. -  MDNode *ReleaseMetadata; +  MDNode *ReleaseMetadata = nullptr;    /// For a top-down sequence, the set of objc_retains or    /// objc_retainBlocks. For bottom-up, the set of objc_releases. @@ -82,11 +86,9 @@ struct RRInfo {    /// If this is true, we cannot perform code motion but can still remove    /// retain/release pairs. -  bool CFGHazardAfflicted; +  bool CFGHazardAfflicted = false; -  RRInfo() -      : KnownSafe(false), IsTailCallRelease(false), ReleaseMetadata(nullptr), -        CFGHazardAfflicted(false) {} +  RRInfo() = default;    void clear(); @@ -100,11 +102,11 @@ struct RRInfo {  class PtrState {  protected:    /// True if the reference count is known to be incremented. -  bool KnownPositiveRefCount; +  bool KnownPositiveRefCount = false;    /// True if we've seen an opportunity for partial RR elimination, such as    /// pushing calls into a CFG triangle or into one side of a CFG diamond. -  bool Partial; +  bool Partial = false;    /// The current position in the sequence.    unsigned char Seq : 8; @@ -112,7 +114,7 @@ protected:    /// Unidirectional information about the current sequence.    RRInfo RRI; -  PtrState() : KnownPositiveRefCount(false), Partial(false), Seq(S_None) {} +  PtrState() : Seq(S_None) {}  public:    bool IsKnownSafe() const { return RRI.KnownSafe; } @@ -165,7 +167,7 @@ public:  };  struct BottomUpPtrState : PtrState { -  BottomUpPtrState() : PtrState() {} +  BottomUpPtrState() = default;    /// (Re-)Initialize this bottom up pointer returning true if we detected a    /// pointer with nested releases. @@ -186,7 +188,7 @@ struct BottomUpPtrState : PtrState {  };  struct TopDownPtrState : PtrState { -  TopDownPtrState() : PtrState() {} +  TopDownPtrState() = default;    /// (Re-)Initialize this bottom up pointer returning true if we detected a    /// pointer with nested releases. @@ -205,6 +207,7 @@ struct TopDownPtrState : PtrState {  };  } // end namespace objcarc +  } // end namespace llvm -#endif +#endif // LLVM_LIB_TRANSFORMS_OBJCARC_PTRSTATE_H | 
