9#ifndef LLDB_UTILITY_STRINGPOOL_H
10#define LLDB_UTILITY_STRINGPOOL_H
14#include "llvm/ADT/StringRef.h"
45 const char *
Intern(llvm::StringRef str);
54 llvm::StringRef mangled);
78 const char *
Intern(llvm::StringRef str)
const {
return m_pool->Intern(str); }
82 return str.empty() ? nullptr :
Intern(str);
A handle to a StringPool that does not own it.
const char * Intern(llvm::StringRef str) const
StringPoolRef(StringPool &pool)
StringPoolRef()
Refers to the global pool.
const char * InternNonEmpty(llvm::StringRef str) const
Like Intern, but an empty string yields nullptr.
A thread-safe pool of interned, null-terminated strings.
std::unique_ptr< PoolEntry[]> m_string_pools
const char * GetConstCString(const char *cstr)
PoolEntry & selectPool(uint32_t hash)
const char * Intern(llvm::StringRef str)
Returns the pooled copy of str, or nullptr if str has no data.
const char * GetMangledCounterpart(llvm::StringRef str)
static StringPoolRef GetSystemPool()
The system pool. Only valid between Initialize and Terminate.
ConstString::MemoryStats GetMemoryStats() const
const char * GetConstCStringWithLength(const char *cstr, size_t cstr_len)
StringPool & operator=(const StringPool &)=delete
static StringPool & GetGlobal()
The pool backing ConstString. It is never destroyed.
static size_t GetConstCStringLength(const char *ccstr)
Length of a string returned by any pool.
static void Initialize()
Set up and tear down the system pool, for strings that are not owned by a Debugger.
const char * GetConstTrimmedCStringWithLength(const char *cstr, size_t cstr_len)
StringPool(const StringPool &)=delete
const char * GetConstCStringAndSetMangledCounterPart(llvm::StringRef demangled, llvm::StringRef mangled)
Interns demangled and links it with the already interned mangled.
A class that represents a running process on the host machine.