clang 22.0.0git
clang::lifetimes::internal::utils Namespace Reference

Classes

struct  ID
 A generic, type-safe wrapper for an ID, distinguished by its Tag type. More...

Enumerations

enum class  JoinKind { Symmetric , Asymmetric }
 Describes the strategy for joining two ImmutableMap instances, primarily differing in how they handle keys that are unique to one of the maps. More...

Functions

template<typename T>
static llvm::ImmutableSet< Tjoin (llvm::ImmutableSet< T > A, llvm::ImmutableSet< T > B, typename llvm::ImmutableSet< T >::Factory &F)
 Computes the union of two ImmutableSets.
template<typename K, typename V, typename Joiner>
static llvm::ImmutableMap< K, Vjoin (const llvm::ImmutableMap< K, V > &A, const llvm::ImmutableMap< K, V > &B, typename llvm::ImmutableMap< K, V >::Factory &F, Joiner JoinValues, JoinKind Kind)
 Computes the key-wise union of two ImmutableMaps.

Enumeration Type Documentation

◆ JoinKind

Describes the strategy for joining two ImmutableMap instances, primarily differing in how they handle keys that are unique to one of the maps.

A Symmetric join is universally correct, while an Asymmetric join serves as a performance optimization. The latter is applicable only when the join operation possesses a left identity element, allowing for a more efficient, one-sided merge.

Enumerator
Symmetric 

A symmetric join applies the JoinValues operation to keys unique to either map, ensuring that values from both maps contribute to the result.

Asymmetric 

An asymmetric join preserves keys unique to the first map as-is, while applying the JoinValues operation only to keys unique to the second map.

Definition at line 56 of file Utils.h.

Function Documentation

◆ join() [1/2]

template<typename K, typename V, typename Joiner>
llvm::ImmutableMap< K, V > clang::lifetimes::internal::utils::join ( const llvm::ImmutableMap< K, V > & A,
const llvm::ImmutableMap< K, V > & B,
typename llvm::ImmutableMap< K, V >::Factory & F,
Joiner JoinValues,
JoinKind Kind )
static

Computes the key-wise union of two ImmutableMaps.

Definition at line 71 of file Utils.h.

References join(), Symmetric, and V.

◆ join() [2/2]

template<typename T>
llvm::ImmutableSet< T > clang::lifetimes::internal::utils::join ( llvm::ImmutableSet< T > A,
llvm::ImmutableSet< T > B,
typename llvm::ImmutableSet< T >::Factory & F )
static

Computes the union of two ImmutableSets.

Definition at line 39 of file Utils.h.

References clang::T.

Referenced by join().