LLDB mainline
lldb_private::clike::IdentifierMap Class Reference

Turns strings into unique Identifier objects. More...

#include <Identifier.h>

Public Member Functions

 ~IdentifierMap ()
Identifier get (llvm::StringRef name)
 Returns an Identifier for name.
Identifier getWithStaticStorageStr (llvm::StringRef name)
 Returns an Identifier for name.

Private Attributes

llvm::BumpPtrAllocator m_string_storage
 Owns the copies made by get().
llvm::DenseSet< llvm::StringRef > m_names
 Set of all created Identifiers strings.

Detailed Description

Turns strings into unique Identifier objects.

Definition at line 39 of file Identifier.h.

Constructor & Destructor Documentation

◆ ~IdentifierMap()

IdentifierMap::~IdentifierMap ( )

Definition at line 39 of file Identifier.cpp.

References m_names.

Member Function Documentation

◆ get()

Identifier IdentifierMap::get ( llvm::StringRef name)

Returns an Identifier for name.

This copies the string into storage owned by this map.

Definition at line 19 of file Identifier.cpp.

References m_names, and m_string_storage.

◆ getWithStaticStorageStr()

Identifier IdentifierMap::getWithStaticStorageStr ( llvm::StringRef name)

Returns an Identifier for name.

This does not make a copy of the passed string and the string storage needs to outlive this IdentifierMap. This is used if name is a string literal or backed by ConstString.

Definition at line 33 of file Identifier.cpp.

References m_names.

Member Data Documentation

◆ m_names

llvm::DenseSet<llvm::StringRef> lldb_private::clike::IdentifierMap::m_names
private

Set of all created Identifiers strings.

Definition at line 59 of file Identifier.h.

Referenced by get(), getWithStaticStorageStr(), and ~IdentifierMap().

◆ m_string_storage

llvm::BumpPtrAllocator lldb_private::clike::IdentifierMap::m_string_storage
private

Owns the copies made by get().

Definition at line 57 of file Identifier.h.

Referenced by get().


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