Skip to content

Commit c054713

Browse files
committed
Adopt llvm::function_ref in availability checking.
The function is a callback parameter that does not escape, therefore function_ref is the right choice. No functionality change.
1 parent a82e999 commit c054713

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

lib/Sema/TypeCheckAvailability.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,10 +1405,11 @@ const AvailableAttr *TypeChecker::getDeprecated(const Decl *D) {
14051405

14061406
/// Returns true if some declaration lexically enclosing the reference
14071407
/// matches the passed in predicate and false otherwise.
1408-
static bool someEnclosingDeclMatches(SourceRange ReferenceRange,
1409-
const DeclContext *ReferenceDC,
1410-
TypeChecker &TC,
1411-
std::function<bool(const Decl *)> Pred) {
1408+
static bool
1409+
someEnclosingDeclMatches(SourceRange ReferenceRange,
1410+
const DeclContext *ReferenceDC,
1411+
TypeChecker &TC,
1412+
llvm::function_ref<bool(const Decl *)> Pred) {
14121413
ASTContext &Ctx = TC.Context;
14131414

14141415
// Climb the DeclContext hierarchy to see if any of the containing
@@ -1500,7 +1501,7 @@ bool TypeChecker::isInsideUnavailableDeclaration(
15001501

15011502
bool TypeChecker::isInsideDeprecatedDeclaration(SourceRange ReferenceRange,
15021503
const DeclContext *ReferenceDC){
1503-
std::function<bool(const Decl *)> IsDeprecated = [](const Decl *D) {
1504+
auto IsDeprecated = [](const Decl *D) {
15041505
return D->getAttrs().getDeprecated(D->getASTContext());
15051506
};
15061507

0 commit comments

Comments
 (0)