clang 22.0.0git
clang::ssaf::EntityIdTable Class Reference

Manages entity name interning and provides efficient EntityId handles. More...

#include "clang/Analysis/Scalable/Model/EntityIdTable.h"

Public Member Functions

 EntityIdTable ()=default
EntityId getId (const EntityName &Name)
 Creates or retrieves an EntityId for the given EntityName.
bool contains (const EntityName &Name) const
 Returns true if an entity with the given name exists in the table.
void forEach (llvm::function_ref< void(const EntityName &, EntityId)> Callback) const
 Invokes the callback for each entity in the table.
size_t count () const
 Returns the number of unique entities in the table.

Detailed Description

Manages entity name interning and provides efficient EntityId handles.

The table maps each unique EntityName to exactly one EntityId. Entities are never removed.

Definition at line 23 of file EntityIdTable.h.

Constructor & Destructor Documentation

◆ EntityIdTable()

clang::ssaf::EntityIdTable::EntityIdTable ( )
default

Member Function Documentation

◆ contains()

bool clang::ssaf::EntityIdTable::contains ( const EntityName & Name) const

Returns true if an entity with the given name exists in the table.

Definition at line 20 of file EntityIdTable.cpp.

◆ count()

size_t clang::ssaf::EntityIdTable::count ( ) const
inline

Returns the number of unique entities in the table.

Definition at line 45 of file EntityIdTable.h.

◆ forEach()

void clang::ssaf::EntityIdTable::forEach ( llvm::function_ref< void(const EntityName &, EntityId)> Callback) const

Invokes the callback for each entity in the table.

Iteration order is unspecified.

Definition at line 24 of file EntityIdTable.cpp.

◆ getId()

EntityId clang::ssaf::EntityIdTable::getId ( const EntityName & Name)

Creates or retrieves an EntityId for the given EntityName.

If the entity already exists in the table, returns its existing Id. Otherwise, creates and returns a new Id. This operation is idempotent.

Definition at line 14 of file EntityIdTable.cpp.


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