[llvm] [NFCI][LLVM] Adopt `ArrayRef::consume_front()` in a few places (PR #146793)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 3 22:00:47 PDT 2025
kazutakahirata wrote:
> > @jurahul @kuhar Is it too late to suggest renaming `consume_front` and `consume_back` to `pop_front` and `pop_back`, respectively? The `pop_front` and `pop_back` are "household names" as we have `std::list::{pop_front,pop_back}` and `std::vector::pop_back`. Aside from a few `consume*` in `StringRef.h`, we don't have any `consume*` under `llvm/include/llvm/ADT`.
>
> Its not :) It was just added yesterday. Though the std::pop_front() and pop_back() do not return the element being popped. The equivalent in SmallVector seems to be pop_back_val(). So we could rename them to be pop_front_val() and pop_back_val().
OK. `pop_front_val` and `pop_back_val` sound good to me. Let's wait to hear from @kuhar.
https://github.com/llvm/llvm-project/pull/146793
More information about the llvm-commits
mailing list