LLVM 22.0.0git
llvm::ir2vec::VocabStorage Class Reference

Generic storage class for section-based vocabularies. More...

#include "llvm/Analysis/IR2Vec.h"

Classes

class  const_iterator
 Iterator support for section-based access. More...

Public Member Functions

 VocabStorage ()
 Default constructor creates empty storage (invalid state)
 VocabStorage (std::vector< std::vector< Embedding > > &&SectionData)
 Create a VocabStorage with pre-organized section data.
 VocabStorage (VocabStorage &&)=default
VocabStorageoperator= (VocabStorage &&)=delete
 VocabStorage (const VocabStorage &)=delete
VocabStorageoperator= (const VocabStorage &)=delete
size_t size () const
 Get total number of entries across all sections.
unsigned getNumSections () const
 Get number of sections.
const std::vector< Embedding > & operator[] (unsigned SectionId) const
 Section-based access: Storage[sectionId][localIndex].
unsigned getDimension () const
 Get vocabulary dimension.
bool isValid () const
 Check if vocabulary is valid (has data)
const_iterator begin () const
const_iterator end () const

Detailed Description

Generic storage class for section-based vocabularies.

VocabStorage provides a generic foundation for storing and accessing embeddings organized into sections.

Definition at line 151 of file IR2Vec.h.

Constructor & Destructor Documentation

◆ VocabStorage() [1/4]

llvm::ir2vec::VocabStorage::VocabStorage ( )
inline

Default constructor creates empty storage (invalid state)

Definition at line 161 of file IR2Vec.h.

Referenced by llvm::ir2vec::VocabStorage::const_iterator::const_iterator(), llvm::ir2vec::Vocabulary::createDummyVocabForTest(), operator=(), operator=(), VocabStorage(), and VocabStorage().

◆ VocabStorage() [2/4]

VocabStorage::VocabStorage ( std::vector< std::vector< Embedding > > && SectionData)

Create a VocabStorage with pre-organized section data.

Definition at line 269 of file IR2Vec.cpp.

References assert(), llvm::move(), and Size.

◆ VocabStorage() [3/4]

llvm::ir2vec::VocabStorage::VocabStorage ( VocabStorage && )
default

References VocabStorage().

◆ VocabStorage() [4/4]

llvm::ir2vec::VocabStorage::VocabStorage ( const VocabStorage & )
delete

References VocabStorage().

Member Function Documentation

◆ begin()

const_iterator llvm::ir2vec::VocabStorage::begin ( ) const
inline

Definition at line 209 of file IR2Vec.h.

◆ end()

const_iterator llvm::ir2vec::VocabStorage::end ( ) const
inline

Definition at line 210 of file IR2Vec.h.

References getNumSections().

◆ getDimension()

unsigned llvm::ir2vec::VocabStorage::getDimension ( ) const
inline

Get vocabulary dimension.

Definition at line 187 of file IR2Vec.h.

◆ getNumSections()

unsigned llvm::ir2vec::VocabStorage::getNumSections ( ) const
inline

Get number of sections.

Definition at line 176 of file IR2Vec.h.

Referenced by end(), and llvm::ir2vec::VocabStorage::const_iterator::operator++().

◆ isValid()

bool llvm::ir2vec::VocabStorage::isValid ( ) const
inline

Check if vocabulary is valid (has data)

Definition at line 190 of file IR2Vec.h.

◆ operator=() [1/2]

VocabStorage & llvm::ir2vec::VocabStorage::operator= ( const VocabStorage & )
delete

References VocabStorage().

◆ operator=() [2/2]

VocabStorage & llvm::ir2vec::VocabStorage::operator= ( VocabStorage && )
delete

References VocabStorage().

◆ operator[]()

const std::vector< Embedding > & llvm::ir2vec::VocabStorage::operator[] ( unsigned SectionId) const
inline

Section-based access: Storage[sectionId][localIndex].

Definition at line 181 of file IR2Vec.h.

References assert().

◆ size()

size_t llvm::ir2vec::VocabStorage::size ( ) const
inline

Get total number of entries across all sections.

Definition at line 173 of file IR2Vec.h.

Referenced by llvm::ir2vec::VocabStorage::const_iterator::operator*().


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