LLVM 23.0.0git
llvm::GlobalValueSummaryMap Class Reference

Map from global value GUID to corresponding summary structures. More...

#include "llvm/IR/ModuleSummaryIndex.h"

Classes

class  SortedEntriesRange
 An owning range over the entries sorted by key, yielding each entry by reference. More...

Public Types

using key_type = GlobalValue::GUID
using mapped_type = GlobalValueSummaryInfo
using value_type = std::pair<key_type, mapped_type>
using iterator = std::deque<value_type>::iterator
using const_iterator = std::deque<value_type>::const_iterator
using size_type = std::deque<value_type>::size_type

Public Member Functions

template<typename... Ts>
std::pair< iterator, booltry_emplace (key_type Key, Ts &&...Args)
iterator find (key_type Key)
const_iterator find (key_type Key) const
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
size_type size () const
bool empty () const
SortedEntriesRange sortedRange () const
 Return an owning range over the entries sorted by key.

Detailed Description

Map from global value GUID to corresponding summary structures.

Use a DenseMap for O(1) lookup and a std::deque for storage. std::deque guarantees that pointers to elements are not invalidated by push_back, which is required because ValueInfo stores a raw pointer to elements of this container.

Definition at line 190 of file ModuleSummaryIndex.h.

Member Typedef Documentation

◆ const_iterator

◆ iterator

using llvm::GlobalValueSummaryMap::iterator = std::deque<value_type>::iterator

Definition at line 195 of file ModuleSummaryIndex.h.

◆ key_type

◆ mapped_type

◆ size_type

using llvm::GlobalValueSummaryMap::size_type = std::deque<value_type>::size_type

Definition at line 197 of file ModuleSummaryIndex.h.

◆ value_type

Definition at line 194 of file ModuleSummaryIndex.h.

Member Function Documentation

◆ begin() [1/2]

iterator llvm::GlobalValueSummaryMap::begin ( )
inline

Definition at line 228 of file ModuleSummaryIndex.h.

◆ begin() [2/2]

const_iterator llvm::GlobalValueSummaryMap::begin ( ) const
inline

Definition at line 229 of file ModuleSummaryIndex.h.

◆ empty()

bool llvm::GlobalValueSummaryMap::empty ( ) const
inline

Definition at line 233 of file ModuleSummaryIndex.h.

◆ end() [1/2]

iterator llvm::GlobalValueSummaryMap::end ( )
inline

Definition at line 230 of file ModuleSummaryIndex.h.

◆ end() [2/2]

const_iterator llvm::GlobalValueSummaryMap::end ( ) const
inline

Definition at line 231 of file ModuleSummaryIndex.h.

◆ find() [1/2]

iterator llvm::GlobalValueSummaryMap::find ( key_type Key)
inline

◆ find() [2/2]

const_iterator llvm::GlobalValueSummaryMap::find ( key_type Key) const
inline

◆ size()

size_type llvm::GlobalValueSummaryMap::size ( ) const
inline

Definition at line 232 of file ModuleSummaryIndex.h.

◆ sortedRange()

SortedEntriesRange llvm::GlobalValueSummaryMap::sortedRange ( ) const
inline

Return an owning range over the entries sorted by key.

Storage is in insertion order; some serialization paths and tests rely on key-sorted iteration.

Definition at line 255 of file ModuleSummaryIndex.h.

◆ try_emplace()

template<typename... Ts>
std::pair< iterator, bool > llvm::GlobalValueSummaryMap::try_emplace ( key_type Key,
Ts &&... Args )
inline

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