LLVM  3.7.0
Public Member Functions | Static Public Attributes | List of all members
llvm::objcarc::ObjCARCAliasAnalysis Class Reference

This is a simple alias analysis implementation that uses knowledge of ARC constructs to answer queries. More...

#include <ObjCARCAliasAnalysis.h>

Inheritance diagram for llvm::objcarc::ObjCARCAliasAnalysis:
[legend]
Collaboration diagram for llvm::objcarc::ObjCARCAliasAnalysis:
[legend]

Public Member Functions

 ObjCARCAliasAnalysis ()
 
- Public Member Functions inherited from llvm::ImmutablePass
virtual void initializePass ()
 initializePass - This method may be overriden by immutable passes to allow them to perform various initialization actions they require. More...
 
ImmutablePassgetAsImmutablePass () override
 
bool runOnModule (Module &) override
 ImmutablePasses are never run. More...
 
 ImmutablePass (char &pid)
 
 ~ImmutablePass () override
 
- Public Member Functions inherited from llvm::ModulePass
PasscreatePrinterPass (raw_ostream &O, const std::string &Banner) const override
 createPrinterPass - Get a module printer pass. More...
 
void assignPassManager (PMStack &PMS, PassManagerType T) override
 Find appropriate Module Pass Manager in the PM Stack and add self into that manager. More...
 
PassManagerType getPotentialPassManagerType () const override
 Return what kind of Pass Manager can manage this pass. More...
 
 ModulePass (char &pid)
 
 ~ModulePass () override
 
- Public Member Functions inherited from llvm::Pass
 Pass (PassKind K, char &pid)
 
virtual ~Pass ()
 
PassKind getPassKind () const
 
virtual const char * getPassName () const
 getPassName - Return a nice clean name for a pass. More...
 
AnalysisID getPassID () const
 getPassID - Return the PassID number that corresponds to this pass. More...
 
virtual bool doFinalization (Module &)
 doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run. More...
 
virtual void print (raw_ostream &O, const Module *M) const
 print - Print out the internal state of the pass. More...
 
void dump () const
 
virtual void preparePassManager (PMStack &)
 Check if available pass managers are suitable for this pass or not. More...
 
void setResolver (AnalysisResolver *AR)
 
AnalysisResolvergetResolver () const
 
virtual void releaseMemory ()
 releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. More...
 
virtual PMDataManagergetAsPMDataManager ()
 
virtual void verifyAnalysis () const
 verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information. More...
 
virtual void dumpPassStructure (unsigned Offset=0)
 
template<typename AnalysisType >
AnalysisType * getAnalysisIfAvailable () const
 getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it. More...
 
bool mustPreserveAnalysisID (char &AID) const
 mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID. More...
 
template<typename AnalysisType >
AnalysisType & getAnalysis () const
 getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More...
 
template<typename AnalysisType >
AnalysisType & getAnalysis (Function &F)
 getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. More...
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI) const
 
template<typename AnalysisType >
AnalysisType & getAnalysisID (AnalysisID PI, Function &F)
 
- Public Member Functions inherited from llvm::AliasAnalysis
 AliasAnalysis ()
 
virtual ~AliasAnalysis ()
 
const TargetLibraryInfogetTargetLibraryInfo () const
 getTargetLibraryInfo - Return a pointer to the current TargetLibraryInfo object, or null if no TargetLibraryInfo object is available. More...
 
uint64_t getTypeStoreSize (Type *Ty)
 getTypeStoreSize - Return the DataLayout store size for the given type, if known, or a conservative value otherwise. More...
 
AliasResult alias (const Value *V1, uint64_t V1Size, const Value *V2, uint64_t V2Size)
 alias - A convenience wrapper. More...
 
AliasResult alias (const Value *V1, const Value *V2)
 alias - A convenience wrapper. More...
 
bool isNoAlias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 isNoAlias - A trivial helper function to check to see if the specified pointers are no-alias. More...
 
bool isNoAlias (const Value *V1, uint64_t V1Size, const Value *V2, uint64_t V2Size)
 isNoAlias - A convenience wrapper. More...
 
bool isNoAlias (const Value *V1, const Value *V2)
 isNoAlias - A convenience wrapper. More...
 
bool isMustAlias (const MemoryLocation &LocA, const MemoryLocation &LocB)
 isMustAlias - A convenience wrapper. More...
 
bool isMustAlias (const Value *V1, const Value *V2)
 isMustAlias - A convenience wrapper. More...
 
bool pointsToConstantMemory (const Value *P, bool OrLocal=false)
 pointsToConstantMemory - A convenient wrapper. More...
 
virtual ModRefResult getArgModRefInfo (ImmutableCallSite CS, unsigned ArgIdx)
 Get the ModRef info associated with a pointer argument of a callsite. More...
 
bool doesNotAccessMemory (ImmutableCallSite CS)
 doesNotAccessMemory - If the specified call is known to never read or write memory, return true. More...
 
bool doesNotAccessMemory (const Function *F)
 doesNotAccessMemory - If the specified function is known to never read or write memory, return true. More...
 
bool onlyReadsMemory (ImmutableCallSite CS)
 onlyReadsMemory - If the specified call is known to only read from non-volatile memory (or not access memory at all), return true. More...
 
bool onlyReadsMemory (const Function *F)
 onlyReadsMemory - If the specified function is known to only read from non-volatile memory (or not access memory at all), return true. More...
 
ModRefResult getModRefInfo (const Instruction *I)
 getModRefInfo - Return information about whether or not an instruction may read or write memory (without regard to a specific location) More...
 
ModRefResult getModRefInfo (const Instruction *I, const MemoryLocation &Loc)
 getModRefInfo - Return information about whether or not an instruction may read or write the specified memory location. More...
 
ModRefResult getModRefInfo (const Instruction *I, const Value *P, uint64_t Size)
 getModRefInfo - A convenience wrapper. More...
 
ModRefResult getModRefInfo (ImmutableCallSite CS, const Value *P, uint64_t Size)
 getModRefInfo (for call sites) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const CallInst *C, const MemoryLocation &Loc)
 getModRefInfo (for calls) - Return information about whether a particular call modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const CallInst *C, const Value *P, uint64_t Size)
 getModRefInfo (for calls) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const InvokeInst *I, const MemoryLocation &Loc)
 getModRefInfo (for invokes) - Return information about whether a particular invoke modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const InvokeInst *I, const Value *P, uint64_t Size)
 getModRefInfo (for invokes) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const LoadInst *L, const MemoryLocation &Loc)
 getModRefInfo (for loads) - Return information about whether a particular load modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const LoadInst *L, const Value *P, uint64_t Size)
 getModRefInfo (for loads) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const StoreInst *S, const MemoryLocation &Loc)
 getModRefInfo (for stores) - Return information about whether a particular store modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const StoreInst *S, const Value *P, uint64_t Size)
 getModRefInfo (for stores) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const FenceInst *S, const MemoryLocation &Loc)
 getModRefInfo (for fences) - Return information about whether a particular store modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const FenceInst *S, const Value *P, uint64_t Size)
 getModRefInfo (for fences) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const AtomicCmpXchgInst *CX, const MemoryLocation &Loc)
 getModRefInfo (for cmpxchges) - Return information about whether a particular cmpxchg modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const AtomicCmpXchgInst *CX, const Value *P, unsigned Size)
 getModRefInfo (for cmpxchges) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const AtomicRMWInst *RMW, const MemoryLocation &Loc)
 getModRefInfo (for atomicrmws) - Return information about whether a particular atomicrmw modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const AtomicRMWInst *RMW, const Value *P, unsigned Size)
 getModRefInfo (for atomicrmws) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (const VAArgInst *I, const MemoryLocation &Loc)
 getModRefInfo (for va_args) - Return information about whether a particular va_arg modifies or reads the specified memory location. More...
 
ModRefResult getModRefInfo (const VAArgInst *I, const Value *P, uint64_t Size)
 getModRefInfo (for va_args) - A convenience wrapper. More...
 
ModRefResult getModRefInfo (Instruction *I, ImmutableCallSite Call)
 getModRefInfo - Return information about whether a call and an instruction may refer to the same memory locations. More...
 
ModRefResult callCapturesBefore (const Instruction *I, const MemoryLocation &MemLoc, DominatorTree *DT)
 callCapturesBefore - Return information about whether a particular call site modifies or reads the specified memory location. More...
 
ModRefResult callCapturesBefore (const Instruction *I, const Value *P, uint64_t Size, DominatorTree *DT)
 callCapturesBefore - A convenience wrapper. More...
 
bool canBasicBlockModify (const BasicBlock &BB, const MemoryLocation &Loc)
 Higher level methods for querying mod/ref information. More...
 
bool canBasicBlockModify (const BasicBlock &BB, const Value *P, uint64_t Size)
 canBasicBlockModify - A convenience wrapper. More...
 
bool canInstructionRangeModRef (const Instruction &I1, const Instruction &I2, const MemoryLocation &Loc, const ModRefResult Mode)
 canInstructionRangeModRef - Return true if it is possible for the execution of the specified instructions to mod(according to the mode) the location Loc. More...
 
bool canInstructionRangeModRef (const Instruction &I1, const Instruction &I2, const Value *Ptr, uint64_t Size, const ModRefResult Mode)
 canInstructionRangeModRef - A convenience wrapper. More...
 
virtual void deleteValue (Value *V)
 Methods that clients should call when they transform the program to allow alias analyses to update their internal data structures. More...
 
virtual void addEscapingUse (Use &U)
 addEscapingUse - This method should be used whenever an escaping use is added to a pointer value. More...
 
void replaceWithNewValue (Value *Old, Value *New)
 replaceWithNewValue - This method is the obvious combination of the two above, and it provided as a helper to simplify client code. More...
 

Static Public Attributes

static char ID = 0
 
- Static Public Attributes inherited from llvm::AliasAnalysis
static char ID = 0
 

Additional Inherited Members

- Public Types inherited from llvm::AliasAnalysis
enum  ModRefResult { NoModRef = 0, Ref = 1, Mod = 2, ModRef = 3 }
 Simple mod/ref information... More...
 
enum  { Nowhere = 0, ArgumentPointees = 4, Anywhere = 8 | ArgumentPointees }
 These values define additional bits used to define the ModRefBehavior values. More...
 
enum  ModRefBehavior {
  DoesNotAccessMemory = Nowhere | NoModRef, OnlyReadsArgumentPointees = ArgumentPointees | Ref, OnlyAccessesArgumentPointees = ArgumentPointees | ModRef, OnlyReadsMemory = Anywhere | Ref,
  UnknownModRefBehavior = Anywhere | ModRef
}
 ModRefBehavior - Summary of how a function affects memory in the program. More...
 
- Static Public Member Functions inherited from llvm::Pass
static const PassInfolookupPassInfo (const void *TI)
 
static const PassInfolookupPassInfo (StringRef Arg)
 
static PasscreatePass (AnalysisID ID)
 
- Static Public Member Functions inherited from llvm::AliasAnalysis
static bool onlyReadsMemory (ModRefBehavior MRB)
 onlyReadsMemory - Return true if functions with the specified behavior are known to only read from non-volatile memory (or not access memory at all). More...
 
static bool onlyAccessesArgPointees (ModRefBehavior MRB)
 onlyAccessesArgPointees - Return true if functions with the specified behavior are known to read and write at most from objects pointed to by their pointer-typed arguments (with arbitrary offsets). More...
 
static bool doesAccessArgPointees (ModRefBehavior MRB)
 doesAccessArgPointees - Return true if functions with the specified behavior are known to potentially read or write from objects pointed to be their pointer-typed arguments (with arbitrary offsets). More...
 
- Protected Member Functions inherited from llvm::AliasAnalysis
void InitializeAliasAnalysis (Pass *P, const DataLayout *DL)
 InitializeAliasAnalysis - Subclasses must call this method to initialize the AliasAnalysis interface before any other methods are called. More...
 
- Protected Attributes inherited from llvm::AliasAnalysis
const DataLayoutDL
 
const TargetLibraryInfoTLI
 

Detailed Description

This is a simple alias analysis implementation that uses knowledge of ARC constructs to answer queries.

TODO: This class could be generalized to know about other ObjC-specific tricks. Such as knowing that ivars in the non-fragile ABI are non-aliasing even though their offsets are dynamic.

Definition at line 38 of file ObjCARCAliasAnalysis.h.

Constructor & Destructor Documentation

llvm::objcarc::ObjCARCAliasAnalysis::ObjCARCAliasAnalysis ( )
inline

Member Data Documentation

char ObjCARCAliasAnalysis::ID = 0
static

Definition at line 41 of file ObjCARCAliasAnalysis.h.


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