clang 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
clang::dataflow::MapLattice< Key, ElementLattice > Class Template Reference

A lattice that maps keys to individual lattice elements. More...

#include "clang/Analysis/FlowSensitive/MapLattice.h"

Public Types

using key_type = Key
 
using mapped_type = ElementLattice
 
using value_type = typename Container::value_type
 
using iterator = typename Container::iterator
 
using const_iterator = typename Container::const_iterator
 

Public Member Functions

 MapLattice ()=default
 
 MapLattice (Container C)
 
std::pair< iterator, boolinsert (const std::pair< const key_type, mapped_type > &P)
 
std::pair< iterator, boolinsert (std::pair< const key_type, mapped_type > &&P)
 
unsigned size () const
 
bool empty () const
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
bool contains (const key_type &K) const
 
iterator find (const key_type &K)
 
const_iterator find (const key_type &K) const
 
mapped_typeoperator[] (const key_type &K)
 
LatticeJoinEffect join (const MapLattice &Other)
 If an entry exists in one map but not the other, the missing entry is treated as implicitly mapping to bottom.
 

Static Public Member Functions

static MapLattice bottom ()
 

Friends

bool operator== (const MapLattice &LHS, const MapLattice &RHS)
 
bool operator!= (const MapLattice &LHS, const MapLattice &RHS)
 

Detailed Description

template<typename Key, typename ElementLattice>
class clang::dataflow::MapLattice< Key, ElementLattice >

A lattice that maps keys to individual lattice elements.

When instantiated with an ElementLattice that is a bounded semi-lattice, MapLattice is itself a bounded semi-lattice, so long as the user limits themselves to a finite number of keys. In that case, top is (implicitly), the map containing all valid keys mapped to top of ElementLattice.

Requirements on ElementLattice:

Definition at line 39 of file MapLattice.h.

Member Typedef Documentation

◆ const_iterator

template<typename Key , typename ElementLattice >
using clang::dataflow::MapLattice< Key, ElementLattice >::const_iterator = typename Container::const_iterator

Definition at line 48 of file MapLattice.h.

◆ iterator

template<typename Key , typename ElementLattice >
using clang::dataflow::MapLattice< Key, ElementLattice >::iterator = typename Container::iterator

Definition at line 47 of file MapLattice.h.

◆ key_type

template<typename Key , typename ElementLattice >
using clang::dataflow::MapLattice< Key, ElementLattice >::key_type = Key

Definition at line 44 of file MapLattice.h.

◆ mapped_type

template<typename Key , typename ElementLattice >
using clang::dataflow::MapLattice< Key, ElementLattice >::mapped_type = ElementLattice

Definition at line 45 of file MapLattice.h.

◆ value_type

template<typename Key , typename ElementLattice >
using clang::dataflow::MapLattice< Key, ElementLattice >::value_type = typename Container::value_type

Definition at line 46 of file MapLattice.h.

Constructor & Destructor Documentation

◆ MapLattice() [1/2]

template<typename Key , typename ElementLattice >
clang::dataflow::MapLattice< Key, ElementLattice >::MapLattice ( )
default

◆ MapLattice() [2/2]

template<typename Key , typename ElementLattice >
clang::dataflow::MapLattice< Key, ElementLattice >::MapLattice ( Container  C)
inlineexplicit

Definition at line 52 of file MapLattice.h.

Member Function Documentation

◆ begin() [1/2]

template<typename Key , typename ElementLattice >
iterator clang::dataflow::MapLattice< Key, ElementLattice >::begin ( )
inline

Definition at line 69 of file MapLattice.h.

◆ begin() [2/2]

template<typename Key , typename ElementLattice >
const_iterator clang::dataflow::MapLattice< Key, ElementLattice >::begin ( ) const
inline

Definition at line 71 of file MapLattice.h.

◆ bottom()

template<typename Key , typename ElementLattice >
static MapLattice clang::dataflow::MapLattice< Key, ElementLattice >::bottom ( )
inlinestatic

◆ contains()

template<typename Key , typename ElementLattice >
bool clang::dataflow::MapLattice< Key, ElementLattice >::contains ( const key_type K) const
inline

Definition at line 85 of file MapLattice.h.

◆ empty()

template<typename Key , typename ElementLattice >
bool clang::dataflow::MapLattice< Key, ElementLattice >::empty ( ) const
inline

Definition at line 67 of file MapLattice.h.

◆ end() [1/2]

template<typename Key , typename ElementLattice >
iterator clang::dataflow::MapLattice< Key, ElementLattice >::end ( )
inline

Definition at line 70 of file MapLattice.h.

◆ end() [2/2]

template<typename Key , typename ElementLattice >
const_iterator clang::dataflow::MapLattice< Key, ElementLattice >::end ( ) const
inline

Definition at line 72 of file MapLattice.h.

◆ find() [1/2]

template<typename Key , typename ElementLattice >
iterator clang::dataflow::MapLattice< Key, ElementLattice >::find ( const key_type K)
inline

Definition at line 87 of file MapLattice.h.

◆ find() [2/2]

template<typename Key , typename ElementLattice >
const_iterator clang::dataflow::MapLattice< Key, ElementLattice >::find ( const key_type K) const
inline

Definition at line 88 of file MapLattice.h.

◆ insert() [1/2]

template<typename Key , typename ElementLattice >
std::pair< iterator, bool > clang::dataflow::MapLattice< Key, ElementLattice >::insert ( const std::pair< const key_type, mapped_type > &  P)
inline

Definition at line 58 of file MapLattice.h.

References P.

◆ insert() [2/2]

template<typename Key , typename ElementLattice >
std::pair< iterator, bool > clang::dataflow::MapLattice< Key, ElementLattice >::insert ( std::pair< const key_type, mapped_type > &&  P)
inline

Definition at line 62 of file MapLattice.h.

References P.

◆ join()

template<typename Key , typename ElementLattice >
LatticeJoinEffect clang::dataflow::MapLattice< Key, ElementLattice >::join ( const MapLattice< Key, ElementLattice > &  Other)
inline

If an entry exists in one map but not the other, the missing entry is treated as implicitly mapping to bottom.

So, the joined map contains the entry as it was in the source map.

Definition at line 95 of file MapLattice.h.

References clang::dataflow::Changed, clang::Other, and clang::dataflow::Unchanged.

◆ operator[]()

template<typename Key , typename ElementLattice >
mapped_type & clang::dataflow::MapLattice< Key, ElementLattice >::operator[] ( const key_type K)
inline

Definition at line 90 of file MapLattice.h.

◆ size()

template<typename Key , typename ElementLattice >
unsigned clang::dataflow::MapLattice< Key, ElementLattice >::size ( ) const
inline

Definition at line 66 of file MapLattice.h.

Friends And Related Function Documentation

◆ operator!=

template<typename Key , typename ElementLattice >
bool operator!= ( const MapLattice< Key, ElementLattice > &  LHS,
const MapLattice< Key, ElementLattice > &  RHS 
)
friend

Definition at line 81 of file MapLattice.h.

◆ operator==

template<typename Key , typename ElementLattice >
bool operator== ( const MapLattice< Key, ElementLattice > &  LHS,
const MapLattice< Key, ElementLattice > &  RHS 
)
friend

Definition at line 77 of file MapLattice.h.


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