LLVM  13.0.0git
Classes | Enumerations | Functions | Variables
llvm::objcarc Namespace Reference

Classes

class  ARCMDKindCache
 A cache of MDKinds used by various ARC optimizations. More...
 
class  ARCRuntimeEntryPoints
 Declarations for ObjC runtime functions and constants. More...
 
struct  BottomUpPtrState
 
class  BundledRetainClaimRVs
 
class  ObjCARCAA
 Analysis pass providing a never-invalidated alias analysis result. More...
 
class  ObjCARCAAResult
 This is a simple alias analysis implementation that uses knowledge of ARC constructs to answer queries. More...
 
class  ObjCARCAAWrapperPass
 Legacy wrapper pass to provide the ObjCARCAAResult object. More...
 
class  ProvenanceAnalysis
 This is similar to BasicAliasAnalysis, and it uses many of the same techniques, except it uses special ObjC-specific reasoning about pointer relationships. More...
 
class  PtrState
 This class summarizes several per-pointer runtime properties which are propagated through the flow graph. More...
 
struct  RRInfo
 Unidirectional information about either a retain-decrement-use-release sequence or release-use-decrement-retain reverse sequence. More...
 
struct  TopDownPtrState
 

Enumerations

enum  ARCMDKindID { ARCMDKindID::ImpreciseRelease, ARCMDKindID::CopyOnEscape, ARCMDKindID::NoObjCARCExceptions }
 
enum  ARCInstKind {
  ARCInstKind::Retain, ARCInstKind::RetainRV, ARCInstKind::ClaimRV, ARCInstKind::RetainBlock,
  ARCInstKind::Release, ARCInstKind::Autorelease, ARCInstKind::AutoreleaseRV, ARCInstKind::AutoreleasepoolPush,
  ARCInstKind::AutoreleasepoolPop, ARCInstKind::NoopCast, ARCInstKind::FusedRetainAutorelease, ARCInstKind::FusedRetainAutoreleaseRV,
  ARCInstKind::LoadWeakRetained, ARCInstKind::StoreWeak, ARCInstKind::InitWeak, ARCInstKind::LoadWeak,
  ARCInstKind::MoveWeak, ARCInstKind::CopyWeak, ARCInstKind::DestroyWeak, ARCInstKind::StoreStrong,
  ARCInstKind::IntrinsicUser, ARCInstKind::CallOrUser, ARCInstKind::Call, ARCInstKind::User,
  ARCInstKind::None
}
 
enum  AttachedCallOperandBundle : unsigned { RVOB_Retain, RVOB_Claim }
 
enum  ARCRuntimeEntryPointKind {
  ARCRuntimeEntryPointKind::AutoreleaseRV, ARCRuntimeEntryPointKind::Release, ARCRuntimeEntryPointKind::Retain, ARCRuntimeEntryPointKind::RetainBlock,
  ARCRuntimeEntryPointKind::Autorelease, ARCRuntimeEntryPointKind::StoreStrong, ARCRuntimeEntryPointKind::RetainRV, ARCRuntimeEntryPointKind::ClaimRV,
  ARCRuntimeEntryPointKind::RetainAutorelease, ARCRuntimeEntryPointKind::RetainAutoreleaseRV
}
 
enum  DependenceKind {
  NeedsPositiveRetainCount, AutoreleasePoolBoundary, CanChangeRetainCount, RetainAutoreleaseDep,
  RetainAutoreleaseRVDep, RetainRVDep
}
 
enum  Sequence {
  S_None, S_Retain, S_CanRelease, S_Use,
  S_Stop, S_MovableRelease
}
 

Functions

bool ModuleHasARC (const Module &M)
 Test if the given module looks interesting to run ARC optimization on. More...
 
const ValueGetUnderlyingObjCPtr (const Value *V)
 This is a wrapper around getUnderlyingObject which also knows how to look through objc_retain and objc_autorelease calls, which we know to return their argument verbatim. More...
 
const ValueGetUnderlyingObjCPtrCached (const Value *V, DenseMap< const Value *, WeakTrackingVH > &Cache)
 A wrapper for GetUnderlyingObjCPtr used for results memoization. More...
 
const ValueGetRCIdentityRoot (const Value *V)
 The RCIdentity root of a value V is a dominating value U for which retaining or releasing U is equivalent to retaining or releasing V. More...
 
ValueGetRCIdentityRoot (Value *V)
 Helper which calls const Value *GetRCIdentityRoot(const Value *V) and just casts away the const of the result. More...
 
ValueGetArgRCIdentityRoot (Value *Inst)
 Assuming the given instruction is one of the special calls such as objc_retain or objc_release, return the RCIdentity root of the argument of the call. More...
 
bool IsNullOrUndef (const Value *V)
 
bool IsNoopInstruction (const Instruction *I)
 
bool IsPotentialRetainableObjPtr (const Value *Op)
 Test whether the given value is possible a retainable object pointer. More...
 
bool IsPotentialRetainableObjPtr (const Value *Op, AAResults &AA)
 
ARCInstKind GetCallSiteClass (const CallBase &CB)
 Helper for GetARCInstKind. More...
 
bool IsObjCIdentifiedObject (const Value *V)
 Return true if this value refers to a distinct and identifiable object. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const ARCInstKind Class)
 
bool IsUser (ARCInstKind Class)
 Test if the given class is a kind of user. More...
 
bool IsRetain (ARCInstKind Class)
 Test if the given class is objc_retain or equivalent. More...
 
bool IsAutorelease (ARCInstKind Class)
 Test if the given class is objc_autorelease or equivalent. More...
 
bool IsForwarding (ARCInstKind Class)
 Test if the given class represents instructions which return their argument verbatim. More...
 
bool IsNoopOnNull (ARCInstKind Class)
 Test if the given class represents instructions which do nothing if passed a null pointer. More...
 
bool IsNoopOnGlobal (ARCInstKind Class)
 Test if the given class represents instructions which do nothing if passed a global variable. More...
 
bool IsAlwaysTail (ARCInstKind Class)
 Test if the given class represents instructions which are always safe to mark with the "tail" keyword. More...
 
bool IsNeverTail (ARCInstKind Class)
 Test if the given class represents instructions which are never safe to mark with the "tail" keyword. More...
 
bool IsNoThrow (ARCInstKind Class)
 Test if the given class represents instructions which are always safe to mark with the nounwind attribute. More...
 
bool CanInterruptRV (ARCInstKind Class)
 Test whether the given instruction can autorelease any pointer or cause an autoreleasepool pop. More...
 
ARCInstKind GetFunctionClass (const Function *F)
 Determine if F is one of the special known Functions. More...
 
ARCInstKind GetBasicARCInstKind (const Value *V)
 Determine which objc runtime call instruction class V belongs to. More...
 
ARCInstKind GetARCInstKind (const Value *V)
 Map V to its ARCInstKind equivalence class. More...
 
bool CanDecrementRefCount (ARCInstKind Kind)
 Returns false if conservatively we can prove that any instruction mapped to this kind can not decrement ref counts. More...
 
const char * getRVMarkerModuleFlagStr ()
 
AttachedCallOperandBundle getAttachedCallOperandBundleEnum (bool IsRetain)
 
bool hasAttachedCallOpBundle (const CallBase *CB, bool IsRetain)
 
bool hasAttachedCallOpBundle (const CallBase *CB)
 
llvm::InstructionfindSingleDependency (DependenceKind Flavor, const Value *Arg, BasicBlock *StartBB, Instruction *StartInst, ProvenanceAnalysis &PA)
 Find dependent instructions. More...
 
bool Depends (DependenceKind Flavor, Instruction *Inst, const Value *Arg, ProvenanceAnalysis &PA)
 Test if there can be dependencies on Inst through Arg. More...
 
bool CanUse (const Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
 Test whether the given instruction can "use" the given pointer's object in a way that requires the reference count to be positive. More...
 
bool CanAlterRefCount (const Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
 Test whether the given instruction can result in a reference count modification (positive or negative) for the pointer's object. More...
 
bool CanDecrementRefCount (const Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA, ARCInstKind Class)
 Returns true if we can not conservatively prove that Inst can not decrement the reference count of Ptr. More...
 
static bool CanDecrementRefCount (const Instruction *Inst, const Value *Ptr, ProvenanceAnalysis &PA)
 
static void EraseInstruction (Instruction *CI)
 Erase the given instruction. More...
 
static const InstructiongetreturnRVOperand (const Instruction &Inst, ARCInstKind Class)
 If Inst is a ReturnRV and its operand is a call or invoke, return the operand. More...
 
template<class PHINodeTy , class VectorTy >
void getEquivalentPHIs (PHINodeTy &PN, VectorTy &PHIList)
 Return the list of PHI nodes that are equivalent to PN. More...
 
static MDStringgetRVInstMarker (Module &M)
 
CallInstcreateCallInstWithColors (FunctionCallee Func, ArrayRef< Value * > Args, const Twine &NameStr, Instruction *InsertBefore, const DenseMap< BasicBlock *, ColorVector > &BlockColors)
 Create a call instruction with the correct funclet token. More...
 
raw_ostreamoperator<< (raw_ostream &OS, const Sequence S) LLVM_ATTRIBUTE_UNUSED
 

Variables

bool EnableARCOpts
 A handy option to enable/disable all ARC Optimizations. More...
 

Enumeration Type Documentation

◆ ARCInstKind

Equivalence classes of instructions in the ARC Model.

Since we do not have "instructions" to represent ARC concepts in LLVM IR, we instead operate on equivalence classes of instructions.

TODO: This should be split into two enums: a runtime entry point enum (possibly united with the ARCRuntimeEntrypoint class) and an enum that deals with effects of instructions in the ARC model (which would handle the notion of a User or CallOrUser).

Enumerator
Retain 

objc_retain

RetainRV 

objc_retainAutoreleasedReturnValue

ClaimRV 

objc_unsafeClaimAutoreleasedReturnValue

RetainBlock 

objc_retainBlock

Release 

objc_release

Autorelease 

objc_autorelease

AutoreleaseRV 

objc_autoreleaseReturnValue

AutoreleasepoolPush 

objc_autoreleasePoolPush

AutoreleasepoolPop 

objc_autoreleasePoolPop

NoopCast 

objc_retainedObject, etc.

FusedRetainAutorelease 

objc_retainAutorelease

FusedRetainAutoreleaseRV 

objc_retainAutoreleaseReturnValue

LoadWeakRetained 

objc_loadWeakRetained (primitive)

StoreWeak 

objc_storeWeak (primitive)

InitWeak 

objc_initWeak (derived)

LoadWeak 

objc_loadWeak (derived)

MoveWeak 

objc_moveWeak (derived)

CopyWeak 

objc_copyWeak (derived)

DestroyWeak 

objc_destroyWeak (derived)

StoreStrong 

objc_storeStrong (derived)

IntrinsicUser 

llvm.objc.clang.arc.use

CallOrUser 

could call objc_release and/or "use" pointers

Call 

could call objc_release

User 

could "use" a pointer

None 

anything that is inert from an ARC perspective.

Definition at line 28 of file ObjCARCInstKind.h.

◆ ARCMDKindID

Enumerator
ImpreciseRelease 
CopyOnEscape 
NoObjCARCExceptions 

Definition at line 219 of file ObjCARCAnalysisUtils.h.

◆ ARCRuntimeEntryPointKind

Enumerator
AutoreleaseRV 
Release 
Retain 
RetainBlock 
Autorelease 
StoreStrong 
RetainRV 
ClaimRV 
RetainAutorelease 
RetainAutoreleaseRV 

Definition at line 37 of file ARCRuntimeEntryPoints.h.

◆ AttachedCallOperandBundle

Enumerator
RVOB_Retain 
RVOB_Claim 

Definition at line 27 of file ObjCARCUtil.h.

◆ DependenceKind

Defines different dependence kinds among various ARC constructs.

There are several kinds of dependence-like concepts in use here.

Enumerator
NeedsPositiveRetainCount 
AutoreleasePoolBoundary 
CanChangeRetainCount 
RetainAutoreleaseDep 

Blocks objc_retainAutorelease.

RetainAutoreleaseRVDep 

Blocks objc_retainAutoreleaseReturnValue.

RetainRVDep 

Blocks objc_retainAutoreleasedReturnValue.

Definition at line 44 of file DependencyAnalysis.h.

◆ Sequence

A sequence of states that a pointer may go through in which an objc_retain and objc_release are actually needed.

Enumerator
S_None 
S_Retain 

objc_retain(x).

S_CanRelease 

foo(x) – x could possibly see a ref count decrement.

S_Use 

any use of x.

S_Stop 

code motion is stopped.

S_MovableRelease 

objc_release(x), !clang.imprecise_release.

Definition at line 41 of file PtrState.h.

Function Documentation

◆ CanAlterRefCount()

bool llvm::objcarc::CanAlterRefCount ( const Instruction Inst,
const Value Ptr,
ProvenanceAnalysis PA,
ARCInstKind  Class 
)

Test whether the given instruction can result in a reference count modification (positive or negative) for the pointer's object.

Definition at line 35 of file DependencyAnalysis.cpp.

References Autorelease, AutoreleaseRV, llvm::objcarc::ProvenanceAnalysis::getAA(), llvm::AAResults::getModRefBehavior(), IntrinsicUser, IsPotentialRetainableObjPtr(), llvm::AAResults::onlyAccessesArgPointees(), llvm::AAResults::onlyReadsMemory(), llvm::objcarc::ProvenanceAnalysis::related(), and User.

Referenced by CanDecrementRefCount(), and Depends().

◆ CanDecrementRefCount() [1/3]

bool llvm::objcarc::CanDecrementRefCount ( ARCInstKind  Kind)

◆ CanDecrementRefCount() [2/3]

static bool llvm::objcarc::CanDecrementRefCount ( const Instruction Inst,
const Value Ptr,
ProvenanceAnalysis PA 
)
inlinestatic

Definition at line 79 of file DependencyAnalysis.h.

References CanDecrementRefCount(), and GetARCInstKind().

◆ CanDecrementRefCount() [3/3]

bool llvm::objcarc::CanDecrementRefCount ( const Instruction Inst,
const Value Ptr,
ProvenanceAnalysis PA,
ARCInstKind  Class 
)

Returns true if we can not conservatively prove that Inst can not decrement the reference count of Ptr.

Returns false if we can.

Definition at line 66 of file DependencyAnalysis.cpp.

References CanAlterRefCount(), and CanDecrementRefCount().

◆ CanInterruptRV()

bool llvm::objcarc::CanInterruptRV ( ARCInstKind  Class)

Test whether the given instruction can autorelease any pointer or cause an autoreleasepool pop.

This means that it could interrupt the RV optimization.

Definition at line 635 of file ObjCARCInstKind.cpp.

References Autorelease, AutoreleasepoolPop, AutoreleasepoolPush, AutoreleaseRV, Call, CallOrUser, ClaimRV, CopyWeak, DestroyWeak, FusedRetainAutorelease, FusedRetainAutoreleaseRV, InitWeak, IntrinsicUser, llvm_unreachable, LoadWeak, LoadWeakRetained, MoveWeak, None, NoopCast, Release, Retain, RetainBlock, RetainRV, StoreStrong, StoreWeak, and User.

Referenced by Depends().

◆ CanUse()

bool llvm::objcarc::CanUse ( const Instruction Inst,
const Value Ptr,
ProvenanceAnalysis PA,
ARCInstKind  Class 
)

◆ createCallInstWithColors()

CallInst * llvm::objcarc::createCallInstWithColors ( FunctionCallee  Func,
ArrayRef< Value * >  Args,
const Twine NameStr,
Instruction InsertBefore,
const DenseMap< BasicBlock *, ColorVector > &  BlockColors 
)

◆ Depends()

bool llvm::objcarc::Depends ( DependenceKind  Flavor,
Instruction Inst,
const Value Arg,
ProvenanceAnalysis PA 
)

Test if there can be dependencies on Inst through Arg.

This function only tests dependencies relevant for removing pairs of calls.

Definition at line 124 of file DependencyAnalysis.cpp.

References Arg, AutoreleasePoolBoundary, AutoreleasepoolPop, AutoreleasepoolPush, CanAlterRefCount(), CanChangeRetainCount, CanInterruptRV(), CanUse(), GetARCInstKind(), GetArgRCIdentityRoot(), GetBasicARCInstKind(), llvm_unreachable, NeedsPositiveRetainCount, None, Retain, RetainAutoreleaseDep, RetainAutoreleaseRVDep, RetainRV, and RetainRVDep.

Referenced by findDependencies().

◆ EraseInstruction()

static void llvm::objcarc::EraseInstruction ( Instruction CI)
inlinestatic

Erase the given instruction.

Many ObjC calls return their argument verbatim, so if it's such a call and the return value has users, replace them with the argument value.

Definition at line 40 of file ObjCARC.h.

References assert(), llvm::Instruction::eraseFromParent(), GetBasicARCInstKind(), IsForwarding(), IsNoopOnNull(), IsNullOrUndef(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), llvm::Value::replaceAllUsesWith(), llvm::Value::stripPointerCasts(), and llvm::Value::use_empty().

Referenced by llvm::objcarc::BundledRetainClaimRVs::eraseInst(), and llvm::objcarc::BundledRetainClaimRVs::~BundledRetainClaimRVs().

◆ findSingleDependency()

llvm::Instruction * llvm::objcarc::findSingleDependency ( DependenceKind  Flavor,
const Value Arg,
BasicBlock StartBB,
Instruction StartInst,
ProvenanceAnalysis PA 
)

Find dependent instructions.

If there is exactly one dependent instruction, return it. Otherwise, return null.

Definition at line 263 of file DependencyAnalysis.cpp.

References Arg, llvm::SmallPtrSetImpl< PtrType >::begin(), findDependencies(), and llvm::SmallPtrSetImplBase::size().

Referenced by FindPredecessorAutoreleaseWithSafePath(), FindPredecessorRetainWithSafePath(), and HasSafePathToPredecessorCall().

◆ GetARCInstKind()

ARCInstKind llvm::objcarc::GetARCInstKind ( const Value V)

◆ GetArgRCIdentityRoot()

Value* llvm::objcarc::GetArgRCIdentityRoot ( Value Inst)
inline

Assuming the given instruction is one of the special calls such as objc_retain or objc_release, return the RCIdentity root of the argument of the call.

Definition at line 128 of file ObjCARCAnalysisUtils.h.

References GetRCIdentityRoot().

Referenced by Depends(), FindPredecessorAutoreleaseWithSafePath(), FindPredecessorRetainWithSafePath(), and findRetainForStoreStrongContraction().

◆ getAttachedCallOperandBundleEnum()

AttachedCallOperandBundle llvm::objcarc::getAttachedCallOperandBundleEnum ( bool  IsRetain)
inline

Definition at line 30 of file ObjCARCUtil.h.

References IsRetain(), RVOB_Claim, and RVOB_Retain.

Referenced by hasAttachedCallOpBundle(), and inlineRetainOrClaimRVCalls().

◆ GetBasicARCInstKind()

ARCInstKind llvm::objcarc::GetBasicARCInstKind ( const Value V)
inline

◆ GetCallSiteClass()

ARCInstKind llvm::objcarc::GetCallSiteClass ( const CallBase CB)
inline

Helper for GetARCInstKind.

Determines what kind of construct CS is.

Definition at line 170 of file ObjCARCAnalysisUtils.h.

References llvm::CallBase::arg_begin(), llvm::CallBase::arg_end(), Call, CallOrUser, E, I, IsPotentialRetainableObjPtr(), None, llvm::CallBase::onlyReadsMemory(), and User.

Referenced by GetARCInstKind().

◆ getEquivalentPHIs()

template<class PHINodeTy , class VectorTy >
void llvm::objcarc::getEquivalentPHIs ( PHINodeTy &  PN,
VectorTy &  PHIList 
)

Return the list of PHI nodes that are equivalent to PN.

Definition at line 75 of file ObjCARC.h.

References BB, E, I, and P.

◆ GetFunctionClass()

ARCInstKind llvm::objcarc::GetFunctionClass ( const Function F)

◆ GetRCIdentityRoot() [1/2]

const Value* llvm::objcarc::GetRCIdentityRoot ( const Value V)
inline

The RCIdentity root of a value V is a dominating value U for which retaining or releasing U is equivalent to retaining or releasing V.

In other words, ARC operations on V are equivalent to ARC operations on U.

We use this in the ARC optimizer to make it easier to match up ARC operations by always mapping ARC operations to RCIdentityRoots instead of pointers themselves.

The two ways that we see RCIdentical values in ObjC are via:

  1. PointerCasts
  2. Forwarding Calls that return their argument verbatim.

Thus this function strips off pointer casts and forwarding calls. NOTE This implies that two RCIdentical values must alias.

Definition at line 107 of file ObjCARCAnalysisUtils.h.

References GetBasicARCInstKind(), IsForwarding(), and llvm::Value::stripPointerCasts().

Referenced by llvm::objcarc::ObjCARCAAResult::alias(), FindSingleUseIdentifiedObject(), GetArgRCIdentityRoot(), GetRCIdentityRoot(), inlineRetainOrClaimRVCalls(), IsObjCIdentifiedObject(), and llvm::objcarc::ObjCARCAAResult::pointsToConstantMemory().

◆ GetRCIdentityRoot() [2/2]

Value* llvm::objcarc::GetRCIdentityRoot ( Value V)
inline

Helper which calls const Value *GetRCIdentityRoot(const Value *V) and just casts away the const of the result.

For documentation about what an RCIdentityRoot (and by extension GetRCIdentityRoot is) look at that function.

Definition at line 121 of file ObjCARCAnalysisUtils.h.

References GetRCIdentityRoot().

◆ getreturnRVOperand()

static const Instruction* llvm::objcarc::getreturnRVOperand ( const Instruction Inst,
ARCInstKind  Class 
)
inlinestatic

If Inst is a ReturnRV and its operand is a call or invoke, return the operand.

Otherwise return null.

Definition at line 62 of file ObjCARC.h.

References llvm::User::getOperand(), RetainRV, and llvm::Value::stripPointerCasts().

Referenced by llvm::objcarc::BottomUpPtrState::HandlePotentialUse().

◆ getRVInstMarker()

static MDString* llvm::objcarc::getRVInstMarker ( Module M)
inlinestatic

Definition at line 93 of file ObjCARC.h.

References getRVMarkerModuleFlagStr(), and M.

◆ getRVMarkerModuleFlagStr()

const char* llvm::objcarc::getRVMarkerModuleFlagStr ( )
inline

Definition at line 23 of file ObjCARCUtil.h.

Referenced by getRVInstMarker().

◆ GetUnderlyingObjCPtr()

const Value* llvm::objcarc::GetUnderlyingObjCPtr ( const Value V)
inline

This is a wrapper around getUnderlyingObject which also knows how to look through objc_retain and objc_autorelease calls, which we know to return their argument verbatim.

Definition at line 69 of file ObjCARCAnalysisUtils.h.

References GetBasicARCInstKind(), llvm::getUnderlyingObject(), and IsForwarding().

Referenced by llvm::objcarc::ObjCARCAAResult::alias(), CanUse(), GetUnderlyingObjCPtrCached(), and llvm::objcarc::ObjCARCAAResult::pointsToConstantMemory().

◆ GetUnderlyingObjCPtrCached()

const Value* llvm::objcarc::GetUnderlyingObjCPtrCached ( const Value V,
DenseMap< const Value *, WeakTrackingVH > &  Cache 
)
inline

◆ hasAttachedCallOpBundle() [1/2]

bool llvm::objcarc::hasAttachedCallOpBundle ( const CallBase CB)
inline

◆ hasAttachedCallOpBundle() [2/2]

bool llvm::objcarc::hasAttachedCallOpBundle ( const CallBase CB,
bool  IsRetain 
)
inline

◆ IsAlwaysTail()

bool llvm::objcarc::IsAlwaysTail ( ARCInstKind  Class)

◆ IsAutorelease()

bool llvm::objcarc::IsAutorelease ( ARCInstKind  Class)

◆ IsForwarding()

bool llvm::objcarc::IsForwarding ( ARCInstKind  Class)

◆ IsNeverTail()

bool llvm::objcarc::IsNeverTail ( ARCInstKind  Class)

Test if the given class represents instructions which are never safe to mark with the "tail" keyword.

It is never safe to tail call objc_autorelease since by tail calling objc_autorelease: fast autoreleasing causing our object to be potentially reclaimed from the autorelease pool which violates the semantics of __autoreleasing types in ARC.

Definition at line 557 of file ObjCARCInstKind.cpp.

References Autorelease, AutoreleasepoolPop, AutoreleasepoolPush, AutoreleaseRV, Call, CallOrUser, ClaimRV, CopyWeak, DestroyWeak, FusedRetainAutorelease, FusedRetainAutoreleaseRV, InitWeak, IntrinsicUser, llvm_unreachable, LoadWeak, LoadWeakRetained, MoveWeak, None, NoopCast, Release, Retain, RetainBlock, RetainRV, StoreStrong, StoreWeak, and User.

Referenced by getOverridingTailCallKind().

◆ IsNoopInstruction()

bool llvm::objcarc::IsNoopInstruction ( const Instruction I)
inline

Definition at line 136 of file ObjCARCAnalysisUtils.h.

References I.

◆ IsNoopOnGlobal()

bool llvm::objcarc::IsNoopOnGlobal ( ARCInstKind  Class)

◆ IsNoopOnNull()

bool llvm::objcarc::IsNoopOnNull ( ARCInstKind  Class)

◆ IsNoThrow()

bool llvm::objcarc::IsNoThrow ( ARCInstKind  Class)

Test if the given class represents instructions which are always safe to mark with the nounwind attribute.

Definition at line 596 of file ObjCARCInstKind.cpp.

References Autorelease, AutoreleasepoolPop, AutoreleasepoolPush, AutoreleaseRV, Call, CallOrUser, ClaimRV, CopyWeak, DestroyWeak, FusedRetainAutorelease, FusedRetainAutoreleaseRV, InitWeak, IntrinsicUser, llvm_unreachable, LoadWeak, LoadWeakRetained, MoveWeak, None, NoopCast, Release, Retain, RetainBlock, RetainRV, StoreStrong, StoreWeak, and User.

◆ IsNullOrUndef()

bool llvm::objcarc::IsNullOrUndef ( const Value V)
inline

Definition at line 132 of file ObjCARCAnalysisUtils.h.

Referenced by EraseInstruction(), and isInertARCValue().

◆ IsObjCIdentifiedObject()

bool llvm::objcarc::IsObjCIdentifiedObject ( const Value V)
inline

Return true if this value refers to a distinct and identifiable object.

This is similar to AliasAnalysis's isIdentifiedObject, except that it uses special knowledge of ObjC conventions.

Definition at line 183 of file ObjCARCAnalysisUtils.h.

References GetRCIdentityRoot(), llvm::StringRef::npos, and llvm::ARMBuildAttrs::Section.

Referenced by FindSingleUseIdentifiedObject().

◆ IsPotentialRetainableObjPtr() [1/2]

bool llvm::objcarc::IsPotentialRetainableObjPtr ( const Value Op)
inline

Test whether the given value is possible a retainable object pointer.

Definition at line 143 of file ObjCARCAnalysisUtils.h.

References Arg.

Referenced by CanAlterRefCount(), CanUse(), GetARCInstKind(), GetCallSiteClass(), and IsPotentialRetainableObjPtr().

◆ IsPotentialRetainableObjPtr() [2/2]

bool llvm::objcarc::IsPotentialRetainableObjPtr ( const Value Op,
AAResults AA 
)

◆ IsRetain()

bool llvm::objcarc::IsRetain ( ARCInstKind  Class)

◆ IsUser()

bool llvm::objcarc::IsUser ( ARCInstKind  Class)

◆ ModuleHasARC()

bool llvm::objcarc::ModuleHasARC ( const Module M)
inline

Test if the given module looks interesting to run ARC optimization on.

Definition at line 43 of file ObjCARCAnalysisUtils.h.

References M.

◆ operator<<() [1/2]

raw_ostream & llvm::objcarc::operator<< ( raw_ostream OS,
const ARCInstKind  Class 
)

◆ operator<<() [2/2]

raw_ostream & llvm::objcarc::operator<< ( raw_ostream OS,
const Sequence  S 
)

Definition at line 37 of file PtrState.cpp.

References llvm_unreachable, S, S_CanRelease, S_MovableRelease, S_None, S_Retain, S_Stop, and S_Use.

Variable Documentation

◆ EnableARCOpts

bool llvm::objcarc::EnableARCOpts