[PATCH] D143976: [ADT] Add lookupOrTrap method to DenseMap and StringMap

Chris Lattner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 10:36:22 PST 2023


lattner added a comment.

Bikeshedding is good @foad, these are important core data structures :)

I agree with you that `at` seems like the right name for this, given the STL precedent. I wasn't aware of that existing for maps.

Renaming lookup -> `lookupOrDefaultConstruct()` or `getValueIfPresent()` or something like that would make sense as well, but seems like a separate issue.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D143976



More information about the llvm-commits mailing list