Browse Source

Attempt to fix build after r244912

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244917 91177308-0d34-0410-b5e6-96231b3b80d8
Ben Langmuir 10 years ago
parent
commit
25d834e010
1 changed files with 7 additions and 4 deletions
  1. 7 4
      lib/Lex/ModuleMap.cpp

+ 7 - 4
lib/Lex/ModuleMap.cpp

@@ -1855,6 +1855,11 @@ void ModuleMapParser::parseHeaderDecl(MMToken::TokenKind LeadingToken,
   }
   }
 }
 }
 
 
+static int compareModuleHeaders(const Module::Header *A,
+                                const Module::Header *B) {
+  return A->NameAsWritten.compare(B->NameAsWritten);
+}
+
 /// \brief Parse an umbrella directory declaration.
 /// \brief Parse an umbrella directory declaration.
 ///
 ///
 ///   umbrella-dir-declaration:
 ///   umbrella-dir-declaration:
@@ -1914,10 +1919,8 @@ void ModuleMapParser::parseUmbrellaDirDecl(SourceLocation UmbrellaLoc) {
     }
     }
 
 
     // Sort header paths so that the pcm doesn't depend on iteration order.
     // 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)
     for (auto &Header : Headers)
       Map.addHeader(ActiveModule, std::move(Header), ModuleMap::TextualHeader);
       Map.addHeader(ActiveModule, std::move(Header), ModuleMap::TextualHeader);
     return;
     return;