LLVM  6.0.0svn
Public Member Functions | Public Attributes | List of all members
llvm::objcarc::RRInfo Struct Reference

Unidirectional information about either a retain-decrement-use-release sequence or release-use-decrement-retain reverse sequence. More...

#include "Transforms/ObjCARC/PtrState.h"

Collaboration diagram for llvm::objcarc::RRInfo:
Collaboration graph
[legend]

Public Member Functions

 RRInfo ()
 
void clear ()
 
bool Merge (const RRInfo &Other)
 Conservatively merge the two RRInfo. More...
 

Public Attributes

bool KnownSafe
 After an objc_retain, the reference count of the referenced object is known to be positive. More...
 
bool IsTailCallRelease
 True of the objc_release calls are all marked with the "tail" keyword. More...
 
MDNodeReleaseMetadata
 If the Calls are objc_release calls and they all have a clang.imprecise_release tag, this is the metadata tag. More...
 
SmallPtrSet< Instruction *, 2 > Calls
 For a top-down sequence, the set of objc_retains or objc_retainBlocks. More...
 
SmallPtrSet< Instruction *, 2 > ReverseInsertPts
 The set of optimal insert positions for moving calls in the opposite sequence. More...
 
bool CFGHazardAfflicted
 If this is true, we cannot perform code motion but can still remove retain/release pairs. More...
 

Detailed Description

Unidirectional information about either a retain-decrement-use-release sequence or release-use-decrement-retain reverse sequence.

Definition at line 53 of file PtrState.h.

Constructor & Destructor Documentation

◆ RRInfo()

llvm::objcarc::RRInfo::RRInfo ( )
inline

Definition at line 87 of file PtrState.h.

References clear(), Merge(), and Other.

Member Function Documentation

◆ clear()

void RRInfo::clear ( )

Definition at line 82 of file PtrState.cpp.

References Calls, CFGHazardAfflicted, IsTailCallRelease, KnownSafe, ReleaseMetadata, and ReverseInsertPts.

Referenced by RRInfo().

◆ Merge()

bool RRInfo::Merge ( const RRInfo Other)

Conservatively merge the two RRInfo.

Returns true if a partial merge has occurred, false otherwise.

Definition at line 91 of file PtrState.cpp.

References Calls, CFGHazardAfflicted, IsTailCallRelease, KnownSafe, ReleaseMetadata, and ReverseInsertPts.

Referenced by llvm::objcarc::PtrState::ClearSequenceProgress(), and RRInfo().

Member Data Documentation

◆ Calls

SmallPtrSet<Instruction *, 2> llvm::objcarc::RRInfo::Calls

For a top-down sequence, the set of objc_retains or objc_retainBlocks.

For bottom-up, the set of objc_releases.

Definition at line 77 of file PtrState.h.

Referenced by clear(), ComputePostOrders(), llvm::objcarc::PtrState::InsertCall(), and Merge().

◆ CFGHazardAfflicted

bool llvm::objcarc::RRInfo::CFGHazardAfflicted

If this is true, we cannot perform code motion but can still remove retain/release pairs.

Definition at line 85 of file PtrState.h.

Referenced by clear(), llvm::objcarc::PtrState::IsCFGHazardAfflicted(), Merge(), and llvm::objcarc::PtrState::SetCFGHazardAfflicted().

◆ IsTailCallRelease

bool llvm::objcarc::RRInfo::IsTailCallRelease

True of the objc_release calls are all marked with the "tail" keyword.

Definition at line 69 of file PtrState.h.

Referenced by clear(), ComputePostOrders(), llvm::objcarc::PtrState::IsTailCallRelease(), Merge(), and llvm::objcarc::PtrState::SetTailCallRelease().

◆ KnownSafe

bool llvm::objcarc::RRInfo::KnownSafe

After an objc_retain, the reference count of the referenced object is known to be positive.

Similarly, before an objc_release, the reference count of the referenced object is known to be positive. If there are retain-release pairs in code regions where the retain count is known to be positive, they can be eliminated, regardless of any side effects between them.

Also, a retain+release pair nested within another retain+release pair all on the known same pointer value can be eliminated, regardless of any intervening side effects.

KnownSafe is true when either of these conditions is satisfied.

Definition at line 66 of file PtrState.h.

Referenced by clear(), ComputePostOrders(), llvm::objcarc::PtrState::IsKnownSafe(), Merge(), and llvm::objcarc::PtrState::SetKnownSafe().

◆ ReleaseMetadata

MDNode* llvm::objcarc::RRInfo::ReleaseMetadata

◆ ReverseInsertPts

SmallPtrSet<Instruction *, 2> llvm::objcarc::RRInfo::ReverseInsertPts

The set of optimal insert positions for moving calls in the opposite sequence.

Definition at line 81 of file PtrState.h.

Referenced by clear(), llvm::objcarc::PtrState::ClearReverseInsertPts(), ComputePostOrders(), llvm::objcarc::PtrState::HasReverseInsertPts(), llvm::objcarc::PtrState::InsertReverseInsertPt(), and Merge().


The documentation for this struct was generated from the following files: