Skip to content

Commit 39ca925

Browse files
[AST] Use llvm::iterator_range::empty (NFC) (llvm#151904)
1 parent c5c2570 commit 39ca925

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

clang/lib/AST/ByteCode/Compiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5914,7 +5914,7 @@ bool Compiler<Emitter>::emitLambdaStaticInvokerBody(const CXXMethodDecl *MD) {
59145914

59155915
const CXXRecordDecl *ClosureClass = MD->getParent();
59165916
const CXXMethodDecl *LambdaCallOp = ClosureClass->getLambdaCallOperator();
5917-
assert(ClosureClass->captures_begin() == ClosureClass->captures_end());
5917+
assert(ClosureClass->captures().empty());
59185918
const Function *Func = this->getFunction(LambdaCallOp);
59195919
if (!Func)
59205920
return false;

clang/lib/AST/ByteCode/Context.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ const Function *Context::getOrCreateFunction(const FunctionDecl *FuncDecl) {
474474
IsLambdaStaticInvoker = true;
475475

476476
const CXXRecordDecl *ClosureClass = MD->getParent();
477-
assert(ClosureClass->captures_begin() == ClosureClass->captures_end());
477+
assert(ClosureClass->captures().empty());
478478
if (ClosureClass->isGenericLambda()) {
479479
const CXXMethodDecl *LambdaCallOp = ClosureClass->getLambdaCallOperator();
480480
assert(MD->isFunctionTemplateSpecialization() &&

clang/lib/AST/DeclCXX.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@ CXXRecordDecl::getVisibleConversionFunctions() const {
19831983
ASTContext &Ctx = getASTContext();
19841984

19851985
ASTUnresolvedSet *Set;
1986-
if (bases_begin() == bases_end()) {
1986+
if (bases().empty()) {
19871987
// If root class, all conversions are visible.
19881988
Set = &data().Conversions.get(Ctx);
19891989
} else {

clang/lib/AST/DeclPrinter.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ void DeclPrinter::VisitObjCMethodDecl(ObjCMethodDecl *OMD) {
14431443
lastPos = pos + 1;
14441444
}
14451445

1446-
if (OMD->param_begin() == OMD->param_end())
1446+
if (OMD->parameters().empty())
14471447
Out << name;
14481448

14491449
if (OMD->isVariadic())
@@ -1480,8 +1480,7 @@ void DeclPrinter::VisitObjCImplementationDecl(ObjCImplementationDecl *OID) {
14801480
}
14811481
Indentation -= Policy.Indentation;
14821482
Out << "}\n";
1483-
}
1484-
else if (SID || (OID->decls_begin() != OID->decls_end())) {
1483+
} else if (SID || !OID->decls().empty()) {
14851484
Out << "\n";
14861485
eolnOut = true;
14871486
}
@@ -1540,8 +1539,7 @@ void DeclPrinter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *OID) {
15401539
}
15411540
Indentation -= Policy.Indentation;
15421541
Out << "}\n";
1543-
}
1544-
else if (SID || (OID->decls_begin() != OID->decls_end())) {
1542+
} else if (SID || !OID->decls().empty()) {
15451543
Out << "\n";
15461544
eolnOut = true;
15471545
}

clang/lib/AST/ExprConstant.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8436,7 +8436,7 @@ class ExprEvaluatorBase
84368436
// doesn't have an implicit argument passed in.
84378437
const CXXRecordDecl *ClosureClass = MD->getParent();
84388438
assert(
8439-
ClosureClass->captures_begin() == ClosureClass->captures_end() &&
8439+
ClosureClass->captures().empty() &&
84408440
"Number of captures must be zero for conversion to function-ptr");
84418441

84428442
const CXXMethodDecl *LambdaCallOp =

clang/lib/AST/QualTypeNames.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ static NestedNameSpecifier *createNestedNameSpecifierForScopeOf(
273273
//
274274
// Make the situation is 'useable' but looking a bit odd by
275275
// picking a random instance as the declaring context.
276-
if (ClassTempl->spec_begin() != ClassTempl->spec_end()) {
276+
if (!ClassTempl->specializations().empty()) {
277277
Decl = *(ClassTempl->spec_begin());
278278
Outer = dyn_cast<NamedDecl>(Decl);
279279
OuterNS = dyn_cast<NamespaceDecl>(Decl);

0 commit comments

Comments
 (0)