summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/ObjCARC/PtrState.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/ObjCARC/PtrState.h')
-rw-r--r--llvm/lib/Transforms/ObjCARC/PtrState.h39
1 files changed, 21 insertions, 18 deletions
diff --git a/llvm/lib/Transforms/ObjCARC/PtrState.h b/llvm/lib/Transforms/ObjCARC/PtrState.h
index 87298fa59bf..e1e95afcf76 100644
--- a/llvm/lib/Transforms/ObjCARC/PtrState.h
+++ b/llvm/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
OpenPOWER on IntegriCloud