[lld] [llvm] [lld][COFF] Remove duplicate strtab entries (PR #141197)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 12 20:23:55 PDT 2025
================
@@ -51,11 +53,15 @@ class StringTableBuilder {
LLVM_ABI StringTableBuilder(Kind K, Align Alignment = Align(1));
LLVM_ABI ~StringTableBuilder();
- /// 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.
- LLVM_ABI size_t add(CachedHashStringRef S);
- size_t add(StringRef S) { return add(CachedHashStringRef(S)); }
+ /// 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. Priority is only useful with reordering. Strings with
+ /// same priority will be put together. Strings with higher priority are
+ /// placed closer to the begin of string table.
+ LLVM_ABI size_t add(CachedHashStringRef S, uint8_t Priority = 0);
----------------
MaskRay wrote:
This comment should mention what if a string is added with different priorities. (std::max below)
https://github.com/llvm/llvm-project/pull/141197
More information about the llvm-commits
mailing list