[llvm] [NFCI][LLVM] Adopt `ArrayRef::consume_front()` in a few places (PR #146793)

Rahul Joshi via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 3 20:08:52 PDT 2025


jurahul 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().

https://github.com/llvm/llvm-project/pull/146793


More information about the llvm-commits mailing list