[clang] 2e0ddbb - [clang] Use llvm::iterator_range::empty (NFC) (#152088)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 5 07:39:25 PDT 2025
Author: Kazu Hirata
Date: 2025-08-05T07:39:21-07:00
New Revision: 2e0ddbb5cd5b4c860cba6197b6977b96b9dde881
URL: https://github.com/llvm/llvm-project/commit/2e0ddbb5cd5b4c860cba6197b6977b96b9dde881
DIFF: https://github.com/llvm/llvm-project/commit/2e0ddbb5cd5b4c860cba6197b6977b96b9dde881.diff
LOG: [clang] Use llvm::iterator_range::empty (NFC) (#152088)
Added:
Modified:
clang/lib/CodeGen/CGDebugInfo.cpp
clang/lib/CodeGen/CGExprCXX.cpp
clang/lib/CodeGen/CGObjCGNU.cpp
clang/lib/CodeGen/CodeGenTBAA.cpp
clang/lib/CodeGen/ItaniumCXXABI.cpp
clang/lib/CodeGen/MicrosoftCXXABI.cpp
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index 5f50b1ccc5a23..2b469f2e265b4 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -2874,7 +2874,7 @@ static bool isDefinedInClangModule(const RecordDecl *RD) {
if (!Explicit && CXXDecl->getEnclosingNamespaceContext())
return false;
// This is a template, check the origin of the first member.
- if (CXXDecl->field_begin() == CXXDecl->field_end())
+ if (CXXDecl->fields().empty())
return TemplateKind == TSK_ExplicitInstantiationDeclaration;
if (!CXXDecl->field_begin()->isFromASTFile())
return false;
diff --git a/clang/lib/CodeGen/CGExprCXX.cpp b/clang/lib/CodeGen/CGExprCXX.cpp
index b8238a4702c4d..c7e53331fe05f 100644
--- a/clang/lib/CodeGen/CGExprCXX.cpp
+++ b/clang/lib/CodeGen/CGExprCXX.cpp
@@ -373,7 +373,7 @@ RValue CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(
bool UseVirtualCall = CanUseVirtualCall && !DevirtualizedMethod;
if (const CXXDestructorDecl *Dtor = dyn_cast<CXXDestructorDecl>(CalleeDecl)) {
- assert(CE->arg_begin() == CE->arg_end() &&
+ assert(CE->arguments().empty() &&
"Destructor shouldn't have explicit parameters");
assert(ReturnValue.isNull() && "Destructor shouldn't have return value");
if (UseVirtualCall) {
diff --git a/clang/lib/CodeGen/CGObjCGNU.cpp b/clang/lib/CodeGen/CGObjCGNU.cpp
index 8acf8d2ddec02..e4147de8fc639 100644
--- a/clang/lib/CodeGen/CGObjCGNU.cpp
+++ b/clang/lib/CodeGen/CGObjCGNU.cpp
@@ -1750,7 +1750,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep {
// struct objc_method_list *methods
// FIXME: Almost identical code is copied and pasted below for the
// class, but refactoring it cleanly requires C++14 generic lambdas.
- if (OID->classmeth_begin() == OID->classmeth_end())
+ if (OID->class_methods().empty())
metaclassFields.addNullPointer(PtrTy);
else {
SmallVector<ObjCMethodDecl*, 16> ClassMethods;
diff --git a/clang/lib/CodeGen/CodeGenTBAA.cpp b/clang/lib/CodeGen/CodeGenTBAA.cpp
index a02a009158d12..90eafe26b548a 100644
--- a/clang/lib/CodeGen/CodeGenTBAA.cpp
+++ b/clang/lib/CodeGen/CodeGenTBAA.cpp
@@ -439,7 +439,7 @@ CodeGenTBAA::CollectFields(uint64_t BaseOffset,
// TODO: Handle C++ base classes.
if (const CXXRecordDecl *Decl = dyn_cast<CXXRecordDecl>(RD))
- if (Decl->bases_begin() != Decl->bases_end())
+ if (!Decl->bases().empty())
return false;
const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index f4a99467010af..aae1481444067 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -2262,7 +2262,7 @@ llvm::Value *ItaniumCXXABI::EmitVirtualDestructorCall(
auto *CE = dyn_cast<const CXXMemberCallExpr *>(E);
auto *D = dyn_cast<const CXXDeleteExpr *>(E);
assert((CE != nullptr) ^ (D != nullptr));
- assert(CE == nullptr || CE->arg_begin() == CE->arg_end());
+ assert(CE == nullptr || CE->arguments().empty());
assert(DtorType == Dtor_Deleting || DtorType == Dtor_Complete);
GlobalDecl GD(Dtor, DtorType);
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index a181559834296..700ffa4beffc1 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -2000,7 +2000,7 @@ llvm::Value *MicrosoftCXXABI::EmitVirtualDestructorCall(
auto *CE = dyn_cast<const CXXMemberCallExpr *>(E);
auto *D = dyn_cast<const CXXDeleteExpr *>(E);
assert((CE != nullptr) ^ (D != nullptr));
- assert(CE == nullptr || CE->arg_begin() == CE->arg_end());
+ assert(CE == nullptr || CE->arguments().empty());
assert(DtorType == Dtor_Deleting || DtorType == Dtor_Complete);
// We have only one destructor in the vftable but can get both behaviors
More information about the cfe-commits
mailing list