LLVM: llvm::UniqueStringSaver Class Reference (original) (raw)
Saves strings in the provided stable storage and returns a StringRef with a stable character pointer. More...
#include "[llvm/Support/StringSaver.h](StringSaver%5F8h%5Fsource.html)"
Public Member Functions | |
---|---|
UniqueStringSaver (BumpPtrAllocator &Alloc) | |
StringRef | save (const char *S) |
StringRef | save (StringRef S) |
StringRef | save (const Twine &S) |
StringRef | save (const std::string &S) |
Detailed Description
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 44 of file StringSaver.h.
Constructor & Destructor Documentation
llvm::UniqueStringSaver::UniqueStringSaver ( BumpPtrAllocator & Alloc) | inline |
---|
Definition at line 49 of file StringSaver.h.
Member Function Documentation
◆ save() [1/4]
StringRef llvm::UniqueStringSaver::save ( const char * S) | inline |
---|
Definition at line 52 of file StringSaver.h.
References save().
Referenced by llvm::NVPTXRegisterInfo::getName(), llvm::ModuleSummaryIndex::getOrInsertTypeIdCompatibleVtableSummary(), llvm::ModuleSummaryIndex::getOrInsertTypeIdSummary(), llvm::NVPTXTargetLowering::LowerCall(), llvm::yaml::MappingTraits< ModuleSummaryIndex >::mapping(), save(), llvm::GlobalValue::setPartition(), and llvm::GlobalObject::setSection().
◆ save() [2/4]
StringRef llvm::UniqueStringSaver::save ( const std::string & S) | inline |
---|
Definition at line 55 of file StringSaver.h.
References save().
Referenced by save().
◆ save() [3/4]
StringRef UniqueStringSaver::save | ( | const Twine & | S | ) |
---|
Definition at line 35 of file StringSaver.cpp.
References save(), and llvm::Twine::toStringRef().
◆ save() [4/4]
StringRef UniqueStringSaver::save | ( | StringRef | S | ) |
---|
Definition at line 28 of file StringSaver.cpp.
References llvm::detail::DenseSetImpl< ValueT, MapTy, ValueInfoT >::insert(), and llvm::StringSaver::save().
The documentation for this class was generated from the following files:
- include/llvm/Support/StringSaver.h
- lib/Support/StringSaver.cpp