LLDB mainline
Public Member Functions | Public Attributes | List of all members
lldb_private::LanguageSet Struct Reference

A SmallBitVector that represents a set of source languages (lldb::LanguageType). More...

#include <Type.h>

Public Member Functions

 LanguageSet ()
 
std::optional< lldb::LanguageTypeGetSingularLanguage ()
 If the set contains a single language only, return it.
 
void Insert (lldb::LanguageType language)
 
bool Empty () const
 
size_t Size () const
 
bool operator[] (unsigned i) const
 

Public Attributes

llvm::SmallBitVector bitvector
 

Detailed Description

A SmallBitVector that represents a set of source languages (lldb::LanguageType).

Each lldb::LanguageType is represented by the bit with the position of its enumerator. The largest LanguageType is < 64, so this is space-efficient and on 64-bit architectures a LanguageSet can be completely stack-allocated.

Definition at line 38 of file Type.h.

Constructor & Destructor Documentation

◆ LanguageSet()

LanguageSet::LanguageSet ( )

Definition at line 26 of file TypeSystem.cpp.

Member Function Documentation

◆ Empty()

bool LanguageSet::Empty ( ) const

◆ GetSingularLanguage()

std::optional< LanguageType > LanguageSet::GetSingularLanguage ( )

If the set contains a single language only, return it.

Definition at line 28 of file TypeSystem.cpp.

References bitvector.

Referenced by GetHomeREPLInitFile(), lldb_private::Target::GetREPL(), and lldb_private::Debugger::RunREPL().

◆ Insert()

void LanguageSet::Insert ( lldb::LanguageType  language)

◆ operator[]()

bool LanguageSet::operator[] ( unsigned  i) const

Definition at line 37 of file TypeSystem.cpp.

References bitvector.

◆ Size()

size_t LanguageSet::Size ( ) const

Definition at line 35 of file TypeSystem.cpp.

References bitvector.

Member Data Documentation

◆ bitvector

llvm::SmallBitVector lldb_private::LanguageSet::bitvector

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