[PATCH] D133715: [ADT] Add HashMappedTrie

Alexey Lapshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 6 06:45:52 PST 2023


avl added a comment.

@steven_wu To have some interface compatibility and to make it possible to use HashMappedTrie for use case from D96035 <https://reviews.llvm.org/D96035> probably,
Could it be possible to add boolean value to the result indicating whether data has just inserted?

  std::pair<pointer, bool> insert(const_pointer Hint, value_type &&HashedData)

The use case for this:

  std::pair<pointer, bool> Result = HashMappedTrie.insert(Data);
  if (Result.second) {
    // initialize Result.first data
    Result.first->field = data;
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133715/new/

https://reviews.llvm.org/D133715



More information about the llvm-commits mailing list