[clang] Use x.empty() instead of llvm::empty(x) (NFC)

I'm planning to deprecate and eventually remove llvm::empty.

Note that no use of llvm::empty requires the ability of llvm::empty to
determine the emptiness from begin/end only.
This commit is contained in:
Kazu Hirata 2022-09-18 11:07:50 -07:00
parent c9696322bd
commit abbe9c561d
2 changed files with 3 additions and 3 deletions

View File

@ -1231,8 +1231,8 @@ static OverloadCompare compareOverloads(const CXXMethodDecl &Candidate,
if (Candidate.parameters()[I]->getType().getCanonicalType() !=
Incumbent.parameters()[I]->getType().getCanonicalType())
return OverloadCompare::BothViable;
if (!llvm::empty(Candidate.specific_attrs<EnableIfAttr>()) ||
!llvm::empty(Incumbent.specific_attrs<EnableIfAttr>()))
if (!Candidate.specific_attrs<EnableIfAttr>().empty() ||
!Incumbent.specific_attrs<EnableIfAttr>().empty())
return OverloadCompare::BothViable;
// At this point, we know calls can't pick one or the other based on
// arguments, so one of the two must win. (Or both fail, handled elsewhere).

View File

@ -1499,7 +1499,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch,
// If switch has default case, then ignore it.
if (!CaseListIsErroneous && !CaseListIsIncomplete && !HasConstantCond &&
ET && ET->getDecl()->isCompleteDefinition() &&
!empty(ET->getDecl()->enumerators())) {
!ET->getDecl()->enumerators().empty()) {
const EnumDecl *ED = ET->getDecl();
EnumValsTy EnumVals;