LLVM 20.0.0git
Public Types | Public Member Functions | List of all members
llvm::AliasResult Class Reference

The possible results of an alias query. More...

#include "llvm/Analysis/AliasAnalysis.h"

Public Types

enum  Kind : uint8_t { NoAlias = 0 , MayAlias , PartialAlias , MustAlias }
 

Public Member Functions

 AliasResult ()=delete
 
constexpr AliasResult (const Kind &Alias)
 
 operator Kind () const
 
bool operator== (const AliasResult &Other) const
 
bool operator!= (const AliasResult &Other) const
 
bool operator== (Kind K) const
 
bool operator!= (Kind K) const
 
constexpr bool hasOffset () const
 
constexpr int32_t getOffset () const
 
void setOffset (int32_t NewOffset)
 
void swap (bool DoSwap=true)
 Helper for processing AliasResult for swapped memory location pairs.
 

Detailed Description

The possible results of an alias query.

These results are always computed between two MemoryLocation objects as a query to some alias analysis.

Note that these are unscoped enumerations because we would like to support implicitly testing a result for the existence of any possible aliasing with a conversion to bool, but an "enum class" doesn't support this. The canonical names from the literature are suffixed and unique anyways, and so they serve as global constants in LLVM for these results.

See docs/AliasAnalysis.html for more information on the specific meanings of these values.

Definition at line 77 of file AliasAnalysis.h.

Member Enumeration Documentation

◆ Kind

enum llvm::AliasResult::Kind : uint8_t
Enumerator
NoAlias 

The two locations do not alias at all.

This value is arranged to convert to false, while all other values
convert to true. This allows a boolean context to convert the result to
a binary flag indicating whether there is the possibility of aliasing. 
MayAlias 

The two locations may or may not alias.

This is the least precise result.

PartialAlias 

The two locations alias, but only due to a partial overlap.

MustAlias 

The two locations precisely alias each other.

Definition at line 89 of file AliasAnalysis.h.

Constructor & Destructor Documentation

◆ AliasResult() [1/2]

llvm::AliasResult::AliasResult ( )
explicitdelete

◆ AliasResult() [2/2]

constexpr llvm::AliasResult::AliasResult ( const Kind Alias)
inlineconstexpr

Definition at line 108 of file AliasAnalysis.h.

Member Function Documentation

◆ getOffset()

constexpr int32_t llvm::AliasResult::getOffset ( ) const
inlineconstexpr

Definition at line 123 of file AliasAnalysis.h.

References assert().

Referenced by llvm::operator<<(), and swap().

◆ hasOffset()

constexpr bool llvm::AliasResult::hasOffset ( ) const
inlineconstexpr

Definition at line 122 of file AliasAnalysis.h.

Referenced by llvm::operator<<(), and swap().

◆ operator Kind()

llvm::AliasResult::operator Kind ( ) const
inline

Definition at line 111 of file AliasAnalysis.h.

◆ operator!=() [1/2]

bool llvm::AliasResult::operator!= ( const AliasResult Other) const
inline

Definition at line 117 of file AliasAnalysis.h.

References llvm::Other.

◆ operator!=() [2/2]

bool llvm::AliasResult::operator!= ( Kind  K) const
inline

Definition at line 120 of file AliasAnalysis.h.

◆ operator==() [1/2]

bool llvm::AliasResult::operator== ( const AliasResult Other) const
inline

Definition at line 113 of file AliasAnalysis.h.

References llvm::Other.

◆ operator==() [2/2]

bool llvm::AliasResult::operator== ( Kind  K) const
inline

Definition at line 119 of file AliasAnalysis.h.

◆ setOffset()

void llvm::AliasResult::setOffset ( int32_t  NewOffset)
inline

Definition at line 127 of file AliasAnalysis.h.

Referenced by swap().

◆ swap()

void llvm::AliasResult::swap ( bool  DoSwap = true)
inline

Helper for processing AliasResult for swapped memory location pairs.

Definition at line 135 of file AliasAnalysis.h.

References getOffset(), hasOffset(), and setOffset().

Referenced by PrintResults().


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