[llvm] [LLVM][DWARF] Refactor code for generating DWARF V5 .debug_names (PR #82394)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 22 00:01:58 PST 2024
================
@@ -613,6 +613,24 @@ enum AcceleratorTable {
DW_hash_function_djb = 0u
};
+// Uniquify the string hashes and calculate the bucket count for the
+// DWARF v5 Accelerator Table.
+inline uint32_t computeDebugNamesUniqueHashes(MutableArrayRef<uint32_t> hashes,
+ uint32_t &uniqueHashCount) {
+ uint32_t BucketCount = 0;
+
+ sort(hashes);
+ uniqueHashCount = llvm::unique(hashes) - hashes.begin();
----------------
jh7370 wrote:
This could be adjusted post-merge? With C++17 structured bindings, returning multiple values via pairs/tuples should really be the norm, rather than using reference parameters as outputs, in my opinion.
https://github.com/llvm/llvm-project/pull/82394
More information about the llvm-commits
mailing list