Replace binary_function by plain function.
- Deprecated in C++11 - Removed in C++17
This commit is contained in:
parent
722018d095
commit
64539621b4
|
@ -2,7 +2,7 @@
|
|||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2014 Ben Vanik. All rights reserved. *
|
||||
* Copyright 2020 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
@ -347,9 +347,9 @@ bool RegisterAllocationPass::SpillOneRegister(HIRBuilder* builder, Block* block,
|
|||
DumpUsage("SpillOneRegister (pre)");
|
||||
// Pick the one with the furthest next use.
|
||||
assert_true(!usage_set->upcoming_uses.empty());
|
||||
auto furthest_usage = std::max_element(usage_set->upcoming_uses.begin(),
|
||||
usage_set->upcoming_uses.end(),
|
||||
RegisterUsage::Comparer());
|
||||
auto furthest_usage =
|
||||
std::max_element(usage_set->upcoming_uses.begin(),
|
||||
usage_set->upcoming_uses.end(), &RegisterUsage::Compare);
|
||||
assert_true(furthest_usage->value->def->block == block);
|
||||
assert_true(furthest_usage->use->instr->block == block);
|
||||
auto spill_value = furthest_usage->value;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2014 Ben Vanik. All rights reserved. *
|
||||
* Copyright 2020 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
|
@ -39,11 +39,9 @@ class RegisterAllocationPass : public CompilerPass {
|
|||
RegisterUsage() : value(nullptr), use(nullptr) {}
|
||||
RegisterUsage(hir::Value* value_, hir::Value::Use* use_)
|
||||
: value(value_), use(use_) {}
|
||||
struct Comparer : std::binary_function<RegisterUsage, RegisterUsage, bool> {
|
||||
bool operator()(const RegisterUsage& a, const RegisterUsage& b) const {
|
||||
return a.use->instr->ordinal < b.use->instr->ordinal;
|
||||
}
|
||||
};
|
||||
static bool Compare(const RegisterUsage& a, const RegisterUsage& b) {
|
||||
return a.use->instr->ordinal < b.use->instr->ordinal;
|
||||
}
|
||||
};
|
||||
struct RegisterSetUsage {
|
||||
const backend::MachineInfo::RegisterSet* set = nullptr;
|
||||
|
|
Loading…
Reference in New Issue