Skip to content

Commit 2e0ddbb

Browse files
[clang] Use llvm::iterator_range::empty (NFC) (#152088)
1 parent cf18e5e commit 2e0ddbb

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

clang/lib/CodeGen/CGDebugInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2874,7 +2874,7 @@ static bool isDefinedInClangModule(const RecordDecl *RD) {
28742874
if (!Explicit && CXXDecl->getEnclosingNamespaceContext())
28752875
return false;
28762876
// This is a template, check the origin of the first member.
2877-
if (CXXDecl->field_begin() == CXXDecl->field_end())
2877+
if (CXXDecl->fields().empty())
28782878
return TemplateKind == TSK_ExplicitInstantiationDeclaration;
28792879
if (!CXXDecl->field_begin()->isFromASTFile())
28802880
return false;

clang/lib/CodeGen/CGExprCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ RValue CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(
373373
bool UseVirtualCall = CanUseVirtualCall && !DevirtualizedMethod;
374374

375375
if (const CXXDestructorDecl *Dtor = dyn_cast<CXXDestructorDecl>(CalleeDecl)) {
376-
assert(CE->arg_begin() == CE->arg_end() &&
376+
assert(CE->arguments().empty() &&
377377
"Destructor shouldn't have explicit parameters");
378378
assert(ReturnValue.isNull() && "Destructor shouldn't have return value");
379379
if (UseVirtualCall) {

clang/lib/CodeGen/CGObjCGNU.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,7 @@ class CGObjCGNUstep2 : public CGObjCGNUstep {
17501750
// struct objc_method_list *methods
17511751
// FIXME: Almost identical code is copied and pasted below for the
17521752
// class, but refactoring it cleanly requires C++14 generic lambdas.
1753-
if (OID->classmeth_begin() == OID->classmeth_end())
1753+
if (OID->class_methods().empty())
17541754
metaclassFields.addNullPointer(PtrTy);
17551755
else {
17561756
SmallVector<ObjCMethodDecl*, 16> ClassMethods;

clang/lib/CodeGen/CodeGenTBAA.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ CodeGenTBAA::CollectFields(uint64_t BaseOffset,
439439

440440
// TODO: Handle C++ base classes.
441441
if (const CXXRecordDecl *Decl = dyn_cast<CXXRecordDecl>(RD))
442-
if (Decl->bases_begin() != Decl->bases_end())
442+
if (!Decl->bases().empty())
443443
return false;
444444

445445
const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);

clang/lib/CodeGen/ItaniumCXXABI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,7 @@ llvm::Value *ItaniumCXXABI::EmitVirtualDestructorCall(
22622262
auto *CE = dyn_cast<const CXXMemberCallExpr *>(E);
22632263
auto *D = dyn_cast<const CXXDeleteExpr *>(E);
22642264
assert((CE != nullptr) ^ (D != nullptr));
2265-
assert(CE == nullptr || CE->arg_begin() == CE->arg_end());
2265+
assert(CE == nullptr || CE->arguments().empty());
22662266
assert(DtorType == Dtor_Deleting || DtorType == Dtor_Complete);
22672267

22682268
GlobalDecl GD(Dtor, DtorType);

clang/lib/CodeGen/MicrosoftCXXABI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,7 @@ llvm::Value *MicrosoftCXXABI::EmitVirtualDestructorCall(
20002000
auto *CE = dyn_cast<const CXXMemberCallExpr *>(E);
20012001
auto *D = dyn_cast<const CXXDeleteExpr *>(E);
20022002
assert((CE != nullptr) ^ (D != nullptr));
2003-
assert(CE == nullptr || CE->arg_begin() == CE->arg_end());
2003+
assert(CE == nullptr || CE->arguments().empty());
20042004
assert(DtorType == Dtor_Deleting || DtorType == Dtor_Complete);
20052005

20062006
// We have only one destructor in the vftable but can get both behaviors

0 commit comments

Comments
 (0)