clang 23.0.0git
clang::ssaf::EntityPointerLevel Class Reference

An EntityPointerLevel represents a level of the declared pointer/array type of an entity. More...

#include "clang/Analysis/Scalable/Analyses/UnsafeBufferUsage/UnsafeBufferUsage.h"

Classes

struct  Comparator

Public Member Functions

EntityId getEntity () const
unsigned getPointerLevel () const
bool operator== (const EntityPointerLevel &Other) const
bool operator!= (const EntityPointerLevel &Other) const
bool operator< (const EntityPointerLevel &Other) const

Friends

class UnsafeBufferUsageTUSummaryBuilder
class UnsafeBufferUsageEntitySummary

Detailed Description

An EntityPointerLevel represents a level of the declared pointer/array type of an entity.

In the fully-expanded spelling of the declared type, a EntityPointerLevel is associated with a '*' (or a '[]`) in that declaration.

For example, for 'int *p[10];', there are two EntityPointerLevels. One is associated with 'int *[10]' of 'p' and the other is associated with 'int *' of 'p'.

An EntityPointerLevel can be identified by an EntityId and an unsigned integer indicating the pointer level: '(EntityId, PointerLevel)'. An EntityPointerLevel 'P' is valid iff

  • 'P.EntityId' has a pointer type with at least 'P.PointerLevel' levels (This implies 'P.PointerLevel > 0');
  • 'P.EntityId' identifies an lvalue object and 'P.PointerLevel == 0'. The latter case represents address-of expressions.

For the same example 'int *p[10];', the EntityPointerLevels below are valid: '(p, 1)' is associated with 'int *[10]' of 'p'; '(p, 2)' is associated with 'int *' of 'p'; '(p, 0)' represents '&p'.

Definition at line 40 of file UnsafeBufferUsage.h.

Member Function Documentation

◆ getEntity()

EntityId clang::ssaf::EntityPointerLevel::getEntity ( ) const
inline

◆ getPointerLevel()

unsigned clang::ssaf::EntityPointerLevel::getPointerLevel ( ) const
inline

Definition at line 52 of file UnsafeBufferUsage.h.

◆ operator!=()

bool clang::ssaf::EntityPointerLevel::operator!= ( const EntityPointerLevel & Other) const
inline

Definition at line 58 of file UnsafeBufferUsage.h.

References clang::Other.

◆ operator<()

bool clang::ssaf::EntityPointerLevel::operator< ( const EntityPointerLevel & Other) const
inline

Definition at line 62 of file UnsafeBufferUsage.h.

References clang::Other.

◆ operator==()

bool clang::ssaf::EntityPointerLevel::operator== ( const EntityPointerLevel & Other) const
inline

Definition at line 54 of file UnsafeBufferUsage.h.

References clang::Other.

◆ UnsafeBufferUsageEntitySummary

friend class UnsafeBufferUsageEntitySummary
friend

Definition at line 45 of file UnsafeBufferUsage.h.

References UnsafeBufferUsageEntitySummary.

Referenced by UnsafeBufferUsageEntitySummary.

◆ UnsafeBufferUsageTUSummaryBuilder

friend class UnsafeBufferUsageTUSummaryBuilder
friend

Definition at line 44 of file UnsafeBufferUsage.h.

References UnsafeBufferUsageTUSummaryBuilder.

Referenced by UnsafeBufferUsageTUSummaryBuilder.


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