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(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 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(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(E); auto *D = dyn_cast(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(E); auto *D = dyn_cast(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