- /// \brief Add a string to the builder. Returns a StringRef to the internal
- /// copy of s. Can only be used before the table is finalized.
- StringRef add(StringRef s) {
- assert(!isFinalized());
- return StringIndexMap.GetOrCreateValue(s, 0).getKey();
- }
+ StringTableBuilder(Kind K);
+
+ /// \brief Add a string to the builder. Returns the position of S in the
+ /// table. The position will be changed if finalize is used.
+ /// Can only be used before the table is finalized.
+ size_t add(StringRef S);