r312336 - std::function -> llvm::function_ref. NFC.

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 1 09:51:51 PDT 2017


Author: d0k
Date: Fri Sep  1 09:51:51 2017
New Revision: 312336

URL: http://llvm.org/viewvc/llvm-project?rev=312336&view=rev
Log:
std::function -> llvm::function_ref. NFC.

Modified:
    cfe/trunk/include/clang/Analysis/CloneDetection.h
    cfe/trunk/include/clang/Parse/Parser.h
    cfe/trunk/lib/Analysis/CloneDetection.cpp
    cfe/trunk/lib/Parse/ParseExpr.cpp

Modified: cfe/trunk/include/clang/Analysis/CloneDetection.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/CloneDetection.h?rev=312336&r1=312335&r2=312336&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/CloneDetection.h (original)
+++ cfe/trunk/include/clang/Analysis/CloneDetection.h Fri Sep  1 09:51:51 2017
@@ -233,9 +233,9 @@ public:
   ///                    filtered.
   /// \param Filter The filter function that should return true for all groups
   ///               that should be removed from the list.
-  static void
-  filterGroups(std::vector<CloneDetector::CloneGroup> &CloneGroups,
-               std::function<bool(const CloneDetector::CloneGroup &)> Filter) {
+  static void filterGroups(
+      std::vector<CloneDetector::CloneGroup> &CloneGroups,
+      llvm::function_ref<bool(const CloneDetector::CloneGroup &)> Filter) {
     CloneGroups.erase(
         std::remove_if(CloneGroups.begin(), CloneGroups.end(), Filter),
         CloneGroups.end());
@@ -249,7 +249,8 @@ public:
   ///                to the same CloneGroup.
   static void splitCloneGroups(
       std::vector<CloneDetector::CloneGroup> &CloneGroups,
-      std::function<bool(const StmtSequence &, const StmtSequence &)> Compare);
+      llvm::function_ref<bool(const StmtSequence &, const StmtSequence &)>
+          Compare);
 };
 
 /// This constraint moves clones into clone groups of type II via hashing.

Modified: cfe/trunk/include/clang/Parse/Parser.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/Parser.h?rev=312336&r1=312335&r2=312336&view=diff
==============================================================================
--- cfe/trunk/include/clang/Parse/Parser.h (original)
+++ cfe/trunk/include/clang/Parse/Parser.h Fri Sep  1 09:51:51 2017
@@ -1521,9 +1521,10 @@ private:
   typedef SmallVector<SourceLocation, 20> CommaLocsTy;
 
   /// ParseExpressionList - Used for C/C++ (argument-)expression-list.
-  bool ParseExpressionList(SmallVectorImpl<Expr *> &Exprs,
-                           SmallVectorImpl<SourceLocation> &CommaLocs,
-                           std::function<void()> Completer = nullptr);
+  bool ParseExpressionList(
+      SmallVectorImpl<Expr *> &Exprs,
+      SmallVectorImpl<SourceLocation> &CommaLocs,
+      llvm::function_ref<void()> Completer = llvm::function_ref<void()>());
 
   /// ParseSimpleExpressionList - A simple comma-separated list of expressions,
   /// used for misc language extensions.

Modified: cfe/trunk/lib/Analysis/CloneDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CloneDetection.cpp?rev=312336&r1=312335&r2=312336&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/CloneDetection.cpp (original)
+++ cfe/trunk/lib/Analysis/CloneDetection.cpp Fri Sep  1 09:51:51 2017
@@ -477,7 +477,8 @@ void MatchingVariablePatternConstraint::
 
 void CloneConstraint::splitCloneGroups(
     std::vector<CloneDetector::CloneGroup> &CloneGroups,
-    std::function<bool(const StmtSequence &, const StmtSequence &)> Compare) {
+    llvm::function_ref<bool(const StmtSequence &, const StmtSequence &)>
+        Compare) {
   std::vector<CloneDetector::CloneGroup> Result;
   for (auto &HashGroup : CloneGroups) {
     // Contains all indexes in HashGroup that were already added to a

Modified: cfe/trunk/lib/Parse/ParseExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExpr.cpp?rev=312336&r1=312335&r2=312336&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExpr.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExpr.cpp Fri Sep  1 09:51:51 2017
@@ -2762,7 +2762,7 @@ ExprResult Parser::ParseFoldExpression(E
 /// \endverbatim
 bool Parser::ParseExpressionList(SmallVectorImpl<Expr *> &Exprs,
                                  SmallVectorImpl<SourceLocation> &CommaLocs,
-                                 std::function<void()> Completer) {
+                                 llvm::function_ref<void()> Completer) {
   bool SawError = false;
   while (1) {
     if (Tok.is(tok::code_completion)) {




More information about the cfe-commits mailing list