[C++11] Revert uses of lambdas with array_pod_sort.

Looks like GCC implements the lambda->function pointer conversion differently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203294 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer
2014-03-07 21:52:38 +00:00
parent e1362f1ebd
commit ba2a549016
2 changed files with 11 additions and 9 deletions
+5 -4
View File
@@ -2860,6 +2860,10 @@ bool GlobalOpt::OptimizeGlobalCtorsList(GlobalVariable *&GCL) {
return true;
}
static int compareNames(Constant *const *A, Constant *const *B) {
return (*A)->getName().compare((*B)->getName());
}
static void setUsedInitializer(GlobalVariable &V,
SmallPtrSet<GlobalValue *, 8> Init) {
if (Init.empty()) {
@@ -2878,10 +2882,7 @@ static void setUsedInitializer(GlobalVariable &V,
UsedArray.push_back(Cast);
}
// Sort to get deterministic order.
array_pod_sort(UsedArray.begin(), UsedArray.end(),
[](Constant *const *A, Constant *const *B) {
return (*A)->getName().compare((*B)->getName());
});
array_pod_sort(UsedArray.begin(), UsedArray.end(), compareNames);
ArrayType *ATy = ArrayType::get(Int8PtrTy, UsedArray.size());
Module *M = V.getParent();