clang 24.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...

Typedefs

template<typename T>
using SetTy
 The lifetime analyses do not benefit from canonicalizing their immutable collections, so they opt out of it via these aliases.
template<typename KeyT, typename ValT>
using MapTy

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>
SetTy< Tjoin (SetTy< T > A, SetTy< T > B, typename SetTy< T >::Factory &F)
 Computes the union of two ImmutableSets.
template<typename KeyT, typename ValT, typename Joiner>
MapTy< KeyT, ValT > join (MapTy< KeyT, ValT > A, MapTy< KeyT, ValT > B, typename MapTy< KeyT, ValT >::Factory &F, Joiner JoinValues, JoinKind Kind)
 Computes the key-wise union of two ImmutableMaps in a single traversal (see ImmutableMap::Factory::mergeWith), sharing subtrees the two maps do not overlap.

Typedef Documentation

◆ MapTy

template<typename KeyT, typename ValT>
using clang::lifetimes::internal::utils::MapTy
Initial value:
llvm::ImmutableMap<KeyT, ValT, llvm::ImutKeyValueInfo<KeyT, ValT>,
false>

Definition at line 44 of file Utils.h.

◆ SetTy

template<typename T>
using clang::lifetimes::internal::utils::SetTy
Initial value:
llvm::ImmutableSet<T, llvm::ImutContainerInfo<T>, false>

The lifetime analyses do not benefit from canonicalizing their immutable collections, so they opt out of it via these aliases.

Definition at line 40 of file Utils.h.

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 60 of file Utils.h.

Function Documentation

◆ join() [1/2]

template<typename KeyT, typename ValT, typename Joiner>
MapTy< KeyT, ValT > clang::lifetimes::internal::utils::join ( MapTy< KeyT, ValT > A,
MapTy< KeyT, ValT > B,
typename MapTy< KeyT, ValT >::Factory & F,
Joiner JoinValues,
JoinKind Kind )

Computes the key-wise union of two ImmutableMaps in a single traversal (see ImmutableMap::Factory::mergeWith), sharing subtrees the two maps do not overlap.

This assumes – as the swap below already does – that JoinValues is commutative with a left identity, which holds for the lifetime lattices.

Definition at line 75 of file Utils.h.

References Asymmetric.

◆ join() [2/2]

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

Computes the union of two ImmutableSets.

Definition at line 49 of file Utils.h.