LLVM 19.0.0git
Classes | Namespaces | Enumerations | Functions | Variables
ObjCARCAnalysisUtils.h File Reference

This file defines common analysis utilities used by the ObjC ARC Optimizer. More...

#include "llvm/Analysis/ObjCARCInstKind.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/ValueHandle.h"
#include <optional>

Go to the source code of this file.


class  llvm::objcarc::ARCMDKindCache
 A cache of MDKinds used by various ARC optimizations. More...


namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
namespace  llvm::objcarc


enum class  llvm::objcarc::ARCMDKindID { llvm::objcarc::ImpreciseRelease , llvm::objcarc::CopyOnEscape , llvm::objcarc::NoObjCARCExceptions }


bool llvm::objcarc::ModuleHasARC (const Module &M)
 Test if the given module looks interesting to run ARC optimization on.
const Value * llvm::objcarc::GetUnderlyingObjCPtr (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.
const Value * llvm::objcarc::GetUnderlyingObjCPtrCached (const Value *V, DenseMap< const Value *, std::pair< WeakVH, WeakTrackingVH > > &Cache)
 A wrapper for GetUnderlyingObjCPtr used for results memoization.
const Value * llvm::objcarc::GetRCIdentityRoot (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.
Value * llvm::objcarc::GetRCIdentityRoot (Value *V)
 Helper which calls const Value *GetRCIdentityRoot(const Value *V) and just casts away the const of the result.
Value * llvm::objcarc::GetArgRCIdentityRoot (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.
bool llvm::objcarc::IsNullOrUndef (const Value *V)
bool llvm::objcarc::IsNoopInstruction (const Instruction *I)
bool llvm::objcarc::IsPotentialRetainableObjPtr (const Value *Op)
 Test whether the given value is possible a retainable object pointer.
bool llvm::objcarc::IsPotentialRetainableObjPtr (const Value *Op, AAResults &AA)
ARCInstKind llvm::objcarc::GetCallSiteClass (const CallBase &CB)
 Helper for GetARCInstKind.
bool llvm::objcarc::IsObjCIdentifiedObject (const Value *V)
 Return true if this value refers to a distinct and identifiable object.


bool llvm::objcarc::EnableARCOpts
 A handy option to enable/disable all ARC Optimizations.

Detailed Description

This file defines common analysis utilities used by the ObjC ARC Optimizer.

ARC stands for Automatic Reference Counting and is a system for managing reference counts for objects in Objective C.

WARNING: This file knows about certain library functions. It recognizes them by name, and hardwires knowledge of their semantics.

WARNING: This file knows about how certain Objective-C library functions are used. Naive LLVM IR transformations which would otherwise be behavior-preserving may break these assumptions.

Definition in file ObjCARCAnalysisUtils.h.