LLVM 22.0.0git
|
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer. More...
#include "llvm/Support/StringSaver.h"
Public Member Functions | |
UniqueStringSaver (BumpPtrAllocator &Alloc) | |
StringRef | save (const char *S) |
LLVM_ABI StringRef | save (StringRef S) |
LLVM_ABI StringRef | save (const Twine &S) |
StringRef | save (const std::string &S) |
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer.
Saving the same string yields the same StringRef.
Compared to StringSaver, it does more work but avoids saving the same string multiple times.
Compared to StringPool, it performs fewer allocations but doesn't support refcounting/deletion.
Definition at line 45 of file StringSaver.h.
|
inline |
Definition at line 50 of file StringSaver.h.
References llvm::Alloc.
Definition at line 53 of file StringSaver.h.
References save().
Referenced by llvm::NVPTXRegisterInfo::getName(), llvm::yaml::MappingTraits< ModuleSummaryIndex >::mapping(), save(), save(), llvm::memprof::saveStringToMap(), llvm::GlobalValue::setPartition(), and llvm::GlobalObject::setSection().
Definition at line 35 of file StringSaver.cpp.
References save(), and llvm::Twine::toStringRef().
Definition at line 28 of file StringSaver.cpp.