Home | History | Annotate | Download | only in src

Lines Matching refs:string

1 //===- subzero/src/IceStringPool.h - String pooling -------------*- C++ -*-===//
13 /// of memory allocation compared to directly using std::string.
25 #include <string>
45 IDType getOrAddString(const std::string &Value) {
48 auto *NewStr = new std::string(Value);
58 Str << "String pool (NumStrings=" << StringToId.size()
70 std::unordered_map<std::string, std::unique_ptr<std::string>> StringToId;
81 /// Create a unique StringID without an actual string, by grabbing the next
86 /// Create a unique StringID that holds an actual string, by fetching or
87 /// adding the string from the Owner's pool.
89 const std::string &Value) {
94 /// std::string value, i.e. via StringID::createWithString().
101 const std::string &toString() const {
105 return *reinterpret_cast<std::string *>(ID);
107 std::string toStringOrEmpty() const {
118 // Do a normal string comparison if both have strings.
121 // Use the ID as a tiebreaker if neither has a string.
124 // If exactly one has a string, then that one comes first.
135 StringID(const typename Traits::OwnerType *Owner, const std::string &Value)
157 std::string operator+(const std::string &A, const StringID<T> &B) {
162 std::string operator+(const StringID<T> &A, const std::string &B) {
172 return hash<std::string>()(Key.toString());