Skip to content

Commit cced356

Browse files
kazutakahiratakrishna2803
authored andcommitted
[Sema] Use llvm::iterator_range::empty (NFC) (llvm#151852)
1 parent d536f14 commit cced356

File tree

5 files changed

+6
-7
lines changed

5 files changed

+6
-7
lines changed

clang/lib/Sema/AnalysisBasedWarnings.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ static ControlFlowKind CheckFallThrough(AnalysisDeclContext &AC) {
581581
// mark them as live.
582582
for (const auto *B : *cfg) {
583583
if (!live[B->getBlockID()]) {
584-
if (B->pred_begin() == B->pred_end()) {
584+
if (B->preds().empty()) {
585585
const Stmt *Term = B->getTerminatorStmt();
586586
if (isa_and_nonnull<CXXTryStmt>(Term))
587587
// When not adding EH edges from calls, catch clauses

clang/lib/Sema/SemaDecl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5255,8 +5255,8 @@ Decl *Sema::ParsedFreeStandingDeclSpec(Scope *S, AccessSpecifier AS,
52555255
if (getLangOpts().CPlusPlus &&
52565256
DS.getStorageClassSpec() != DeclSpec::SCS_typedef)
52575257
if (EnumDecl *Enum = dyn_cast_or_null<EnumDecl>(Tag))
5258-
if (Enum->enumerator_begin() == Enum->enumerator_end() &&
5259-
!Enum->getIdentifier() && !Enum->isInvalidDecl())
5258+
if (Enum->enumerators().empty() && !Enum->getIdentifier() &&
5259+
!Enum->isInvalidDecl())
52605260
DeclaresAnything = false;
52615261

52625262
if (!DS.isMissingDeclaratorOk()) {

clang/lib/Sema/SemaExpr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6523,8 +6523,7 @@ ExprResult Sema::ActOnCallExpr(Scope *Scope, Expr *Fn, SourceLocation LParenLoc,
65236523
// Diagnose uses of the C++20 "ADL-only template-id call" feature in earlier
65246524
// language modes.
65256525
if (const auto *ULE = dyn_cast<UnresolvedLookupExpr>(Fn);
6526-
ULE && ULE->hasExplicitTemplateArgs() &&
6527-
ULE->decls_begin() == ULE->decls_end()) {
6526+
ULE && ULE->hasExplicitTemplateArgs() && ULE->decls().empty()) {
65286527
DiagCompat(Fn->getExprLoc(), diag_compat::adl_only_template_id)
65296528
<< ULE->getName();
65306529
}

clang/lib/Sema/SemaInit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4836,7 +4836,7 @@ static void TryReferenceListInitialization(Sema &S,
48364836
}
48374837

48384838
// Update the initializer if we've resolved an overloaded function.
4839-
if (Sequence.step_begin() != Sequence.step_end())
4839+
if (!Sequence.steps().empty())
48404840
Sequence.RewrapReferenceInitList(cv1T1, InitList);
48414841
}
48424842
// Perform address space compatibility check.

clang/lib/Sema/SemaLookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3130,7 +3130,7 @@ addAssociatedClassesAndNamespaces(AssociatedLookup &Result,
31303130
CollectEnclosingNamespace(Result.Namespaces, BaseCtx);
31313131

31323132
// Make sure we visit the bases of this base class.
3133-
if (BaseDecl->bases_begin() != BaseDecl->bases_end())
3133+
if (!BaseDecl->bases().empty())
31343134
Bases.push_back(BaseDecl);
31353135
}
31363136
}

0 commit comments

Comments
 (0)