mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
[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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user