Skip to content

[clang] Use llvm::iterator_range::empty (NFC) #152088

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CGDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CGExprCXX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CGObjCGNU.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CodeGenTBAA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/ItaniumCXXABI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/MicrosoftCXXABI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down