r244917 - Attempt to fix build after r244912

Ben Langmuir via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 13 10:30:07 PDT 2015


Author: benlangmuir
Date: Thu Aug 13 12:30:07 2015
New Revision: 244917

URL: http://llvm.org/viewvc/llvm-project?rev=244917&view=rev
Log:
Attempt to fix build after r244912

Some compilers were less happy about converting a lambda to a comparator
function for array_pod_sort.

Modified:
    cfe/trunk/lib/Lex/ModuleMap.cpp

Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=244917&r1=244916&r2=244917&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Thu Aug 13 12:30:07 2015
@@ -1855,6 +1855,11 @@ void ModuleMapParser::parseHeaderDecl(MM
   }
 }
 
+static int compareModuleHeaders(const Module::Header *A,
+                                const Module::Header *B) {
+  return A->NameAsWritten.compare(B->NameAsWritten);
+}
+
 /// \brief Parse an umbrella directory declaration.
 ///
 ///   umbrella-dir-declaration:
@@ -1914,10 +1919,8 @@ void ModuleMapParser::parseUmbrellaDirDe
     }
 
     // Sort header paths so that the pcm doesn't depend on iteration order.
-    llvm::array_pod_sort(Headers.begin(), Headers.end(),
-                         [](const Module::Header *A, const Module::Header *B) {
-                           return A->NameAsWritten.compare(B->NameAsWritten);
-                         });
+    llvm::array_pod_sort(Headers.begin(), Headers.end(), compareModuleHeaders);
+
     for (auto &Header : Headers)
       Map.addHeader(ActiveModule, std::move(Header), ModuleMap::TextualHeader);
     return;




More information about the cfe-commits mailing list