From: Benjamin Kramer Date: Mon, 12 Dec 2016 14:41:19 +0000 (+0000) Subject: Use function_ref to avoid allocation in std::function. NFC. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44dbffde720d6ecc666357e708997ad6995c4978;p=clang Use function_ref to avoid allocation in std::function. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289433 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index b08c698d0b..2028d2cd78 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -10029,7 +10029,8 @@ public: /// local diagnostics like in reference binding. void RefersToMemberWithReducedAlignment( Expr *E, - std::function Action); + llvm::function_ref + Action); }; /// \brief RAII object that enters a new expression evaluation context. diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index fd0654b3ff..6a9afc4deb 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -11816,7 +11816,8 @@ void Sema::DiscardMisalignedMemberAddress(const Type *T, Expr *E) { void Sema::RefersToMemberWithReducedAlignment( Expr *E, - std::function Action) { + llvm::function_ref + Action) { const auto *ME = dyn_cast(E); if (!ME) return;