LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::MemoryEffectsBase< LocationEnum > Class Template Reference

#include "llvm/Support/ModRef.h"

Public Types

using Location = LocationEnum
 

Public Member Functions

 MemoryEffectsBase (Location Loc, ModRefInfo MR)
 Create MemoryEffectsBase that can access only the given location with the given ModRefInfo.
 
 MemoryEffectsBase (ModRefInfo MR)
 Create MemoryEffectsBase that can access any location with the given ModRefInfo.
 
uint32_t toIntValue () const
 Convert MemoryEffectsBase into an encoded integer value (used by memory attribute).
 
ModRefInfo getModRef (Location Loc) const
 Get ModRefInfo for the given Location.
 
MemoryEffectsBase getWithModRef (Location Loc, ModRefInfo MR) const
 Get new MemoryEffectsBase with modified ModRefInfo for Loc.
 
MemoryEffectsBase getWithoutLoc (Location Loc) const
 Get new MemoryEffectsBase with NoModRef on the given Loc.
 
ModRefInfo getModRef () const
 Get ModRefInfo for any location.
 
bool doesNotAccessMemory () const
 Whether this function accesses no memory.
 
bool onlyReadsMemory () const
 Whether this function only (at most) reads memory.
 
bool onlyWritesMemory () const
 Whether this function only (at most) writes memory.
 
bool onlyAccessesArgPointees () const
 Whether this function only (at most) accesses argument memory.
 
bool doesAccessArgPointees () const
 Whether this function may access argument memory.
 
bool onlyAccessesInaccessibleMem () const
 Whether this function only (at most) accesses inaccessible memory.
 
bool onlyAccessesInaccessibleOrArgMem () const
 Whether this function only (at most) accesses argument and inaccessible memory.
 
MemoryEffectsBase operator& (MemoryEffectsBase Other) const
 Intersect with other MemoryEffectsBase.
 
MemoryEffectsBaseoperator&= (MemoryEffectsBase Other)
 Intersect (in-place) with other MemoryEffectsBase.
 
MemoryEffectsBase operator| (MemoryEffectsBase Other) const
 Union with other MemoryEffectsBase.
 
MemoryEffectsBaseoperator|= (MemoryEffectsBase Other)
 Union (in-place) with other MemoryEffectsBase.
 
MemoryEffectsBase operator- (MemoryEffectsBase Other) const
 Subtract other MemoryEffectsBase.
 
MemoryEffectsBaseoperator-= (MemoryEffectsBase Other)
 Subtract (in-place) with other MemoryEffectsBase.
 
bool operator== (MemoryEffectsBase Other) const
 Check whether this is the same as other MemoryEffectsBase.
 
bool operator!= (MemoryEffectsBase Other) const
 Check whether this is different from other MemoryEffectsBase.
 

Static Public Member Functions

static auto locations ()
 Returns iterator over all supported location kinds.
 
static MemoryEffectsBase unknown ()
 Create MemoryEffectsBase that can read and write any memory.
 
static MemoryEffectsBase none ()
 Create MemoryEffectsBase that cannot read or write any memory.
 
static MemoryEffectsBase readOnly ()
 Create MemoryEffectsBase that can read any memory.
 
static MemoryEffectsBase writeOnly ()
 Create MemoryEffectsBase that can write any memory.
 
static MemoryEffectsBase argMemOnly (ModRefInfo MR=ModRefInfo::ModRef)
 Create MemoryEffectsBase that can only access argument memory.
 
static MemoryEffectsBase inaccessibleMemOnly (ModRefInfo MR=ModRefInfo::ModRef)
 Create MemoryEffectsBase that can only access inaccessible memory.
 
static MemoryEffectsBase inaccessibleOrArgMemOnly (ModRefInfo MR=ModRefInfo::ModRef)
 Create MemoryEffectsBase that can only access inaccessible or argument memory.
 
static MemoryEffectsBase createFromIntValue (uint32_t Data)
 Create MemoryEffectsBase from an encoded integer value (used by memory attribute).
 

Detailed Description

template<typename LocationEnum>
class llvm::MemoryEffectsBase< LocationEnum >

Definition at line 72 of file ModRef.h.

Member Typedef Documentation

◆ Location

template<typename LocationEnum >
using llvm::MemoryEffectsBase< LocationEnum >::Location = LocationEnum

Definition at line 74 of file ModRef.h.

Constructor & Destructor Documentation

◆ MemoryEffectsBase() [1/2]

template<typename LocationEnum >
llvm::MemoryEffectsBase< LocationEnum >::MemoryEffectsBase ( Location  Loc,
ModRefInfo  MR 
)
inline

Create MemoryEffectsBase that can access only the given location with the given ModRefInfo.

Definition at line 102 of file ModRef.h.

◆ MemoryEffectsBase() [2/2]

template<typename LocationEnum >
llvm::MemoryEffectsBase< LocationEnum >::MemoryEffectsBase ( ModRefInfo  MR)
inlineexplicit

Create MemoryEffectsBase that can access any location with the given ModRefInfo.

Definition at line 106 of file ModRef.h.

References llvm::MemoryEffectsBase< LocationEnum >::locations().

Member Function Documentation

◆ argMemOnly()

template<typename LocationEnum >
static MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::argMemOnly ( ModRefInfo  MR = ModRefInfo::ModRef)
inlinestatic

◆ createFromIntValue()

template<typename LocationEnum >
static MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::createFromIntValue ( uint32_t  Data)
inlinestatic

Create MemoryEffectsBase from an encoded integer value (used by memory attribute).

Definition at line 154 of file ModRef.h.

Referenced by llvm::Attribute::getMemoryEffects().

◆ doesAccessArgPointees()

template<typename LocationEnum >
bool llvm::MemoryEffectsBase< LocationEnum >::doesAccessArgPointees ( ) const
inline

Whether this function may access argument memory.

Definition at line 206 of file ModRef.h.

References llvm::MemoryEffectsBase< LocationEnum >::getModRef(), and llvm::isModOrRefSet().

◆ doesNotAccessMemory()

template<typename LocationEnum >
bool llvm::MemoryEffectsBase< LocationEnum >::doesNotAccessMemory ( ) const
inline

◆ getModRef() [1/2]

template<typename LocationEnum >
ModRefInfo llvm::MemoryEffectsBase< LocationEnum >::getModRef ( ) const
inline

◆ getModRef() [2/2]

template<typename LocationEnum >
ModRefInfo llvm::MemoryEffectsBase< LocationEnum >::getModRef ( Location  Loc) const
inline

◆ getWithModRef()

template<typename LocationEnum >
MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::getWithModRef ( Location  Loc,
ModRefInfo  MR 
) const
inline

Get new MemoryEffectsBase with modified ModRefInfo for Loc.

Definition at line 170 of file ModRef.h.

◆ getWithoutLoc()

template<typename LocationEnum >
MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::getWithoutLoc ( Location  Loc) const
inline

◆ inaccessibleMemOnly()

template<typename LocationEnum >
static MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::inaccessibleMemOnly ( ModRefInfo  MR = ModRefInfo::ModRef)
inlinestatic

◆ inaccessibleOrArgMemOnly()

template<typename LocationEnum >
static MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::inaccessibleOrArgMemOnly ( ModRefInfo  MR = ModRefInfo::ModRef)
inlinestatic

◆ locations()

template<typename LocationEnum >
static auto llvm::MemoryEffectsBase< LocationEnum >::locations ( )
inlinestatic

◆ none()

template<typename LocationEnum >
static MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::none ( )
inlinestatic

◆ onlyAccessesArgPointees()

template<typename LocationEnum >
bool llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesArgPointees ( ) const
inline

◆ onlyAccessesInaccessibleMem()

template<typename LocationEnum >
bool llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleMem ( ) const
inline

◆ onlyAccessesInaccessibleOrArgMem()

template<typename LocationEnum >
bool llvm::MemoryEffectsBase< LocationEnum >::onlyAccessesInaccessibleOrArgMem ( ) const
inline

◆ onlyReadsMemory()

template<typename LocationEnum >
bool llvm::MemoryEffectsBase< LocationEnum >::onlyReadsMemory ( ) const
inline

◆ onlyWritesMemory()

template<typename LocationEnum >
bool llvm::MemoryEffectsBase< LocationEnum >::onlyWritesMemory ( ) const
inline

◆ operator!=()

template<typename LocationEnum >
bool llvm::MemoryEffectsBase< LocationEnum >::operator!= ( MemoryEffectsBase< LocationEnum >  Other) const
inline

Check whether this is different from other MemoryEffectsBase.

Definition at line 260 of file ModRef.h.

References llvm::MemoryEffectsBase< LocationEnum >::operator==(), and llvm::Other.

◆ operator&()

template<typename LocationEnum >
MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::operator& ( MemoryEffectsBase< LocationEnum >  Other) const
inline

Intersect with other MemoryEffectsBase.

Definition at line 224 of file ModRef.h.

References llvm::Other.

◆ operator&=()

template<typename LocationEnum >
MemoryEffectsBase & llvm::MemoryEffectsBase< LocationEnum >::operator&= ( MemoryEffectsBase< LocationEnum >  Other)
inline

Intersect (in-place) with other MemoryEffectsBase.

Definition at line 229 of file ModRef.h.

References llvm::Other.

◆ operator-()

template<typename LocationEnum >
MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::operator- ( MemoryEffectsBase< LocationEnum >  Other) const
inline

Subtract other MemoryEffectsBase.

Definition at line 246 of file ModRef.h.

References llvm::Other.

◆ operator-=()

template<typename LocationEnum >
MemoryEffectsBase & llvm::MemoryEffectsBase< LocationEnum >::operator-= ( MemoryEffectsBase< LocationEnum >  Other)
inline

Subtract (in-place) with other MemoryEffectsBase.

Definition at line 251 of file ModRef.h.

◆ operator==()

template<typename LocationEnum >
bool llvm::MemoryEffectsBase< LocationEnum >::operator== ( MemoryEffectsBase< LocationEnum >  Other) const
inline

Check whether this is the same as other MemoryEffectsBase.

Definition at line 257 of file ModRef.h.

References llvm::Other.

Referenced by llvm::MemoryEffectsBase< LocationEnum >::operator!=().

◆ operator|()

template<typename LocationEnum >
MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::operator| ( MemoryEffectsBase< LocationEnum >  Other) const
inline

Union with other MemoryEffectsBase.

Definition at line 235 of file ModRef.h.

References llvm::Other.

◆ operator|=()

template<typename LocationEnum >
MemoryEffectsBase & llvm::MemoryEffectsBase< LocationEnum >::operator|= ( MemoryEffectsBase< LocationEnum >  Other)
inline

Union (in-place) with other MemoryEffectsBase.

Definition at line 240 of file ModRef.h.

References llvm::Other.

◆ readOnly()

template<typename LocationEnum >
static MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::readOnly ( )
inlinestatic

◆ toIntValue()

template<typename LocationEnum >
uint32_t llvm::MemoryEffectsBase< LocationEnum >::toIntValue ( ) const
inline

Convert MemoryEffectsBase into an encoded integer value (used by memory attribute).

Definition at line 160 of file ModRef.h.

Referenced by llvm::AttrBuilder::addMemoryAttr(), and llvm::Attribute::getWithMemoryEffects().

◆ unknown()

template<typename LocationEnum >
static MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::unknown ( )
inlinestatic

◆ writeOnly()

template<typename LocationEnum >
static MemoryEffectsBase llvm::MemoryEffectsBase< LocationEnum >::writeOnly ( )
inlinestatic

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