From 5deeb6a82e47d060f7448df3cf13e6c14650b068 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 29 Sep 2025 09:50:17 -0700 Subject: [PATCH] [ADT] Add const to AllocatorList::{empty,size} While I am at it, this patch adds [[nodiscard]]. --- llvm/include/llvm/ADT/AllocatorList.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llvm/include/llvm/ADT/AllocatorList.h b/llvm/include/llvm/ADT/AllocatorList.h index 04d0afc9d076e..2716b83ca224a 100644 --- a/llvm/include/llvm/ADT/AllocatorList.h +++ b/llvm/include/llvm/ADT/AllocatorList.h @@ -155,8 +155,8 @@ template class AllocatorList : AllocatorT { std::swap(getAlloc(), RHS.getAlloc()); } - bool empty() { return List.empty(); } - size_t size() { return List.size(); } + [[nodiscard]] bool empty() const { return List.empty(); } + [[nodiscard]] size_t size() const { return List.size(); } iterator begin() { return iterator(List.begin()); } iterator end() { return iterator(List.end()); }