mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static but not intended to be global. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -114,19 +114,21 @@ ValueEnumerator::ValueEnumerator(const Module *M) {
|
||||
}
|
||||
|
||||
// Optimize constant ordering.
|
||||
struct CstSortPredicate {
|
||||
ValueEnumerator &VE;
|
||||
CstSortPredicate(ValueEnumerator &ve) : VE(ve) {}
|
||||
bool operator()(const std::pair<const Value*, unsigned> &LHS,
|
||||
const std::pair<const Value*, unsigned> &RHS) {
|
||||
// Sort by plane.
|
||||
if (LHS.first->getType() != RHS.first->getType())
|
||||
return VE.getTypeID(LHS.first->getType()) <
|
||||
VE.getTypeID(RHS.first->getType());
|
||||
// Then by frequency.
|
||||
return LHS.second > RHS.second;
|
||||
}
|
||||
};
|
||||
namespace {
|
||||
struct CstSortPredicate {
|
||||
ValueEnumerator &VE;
|
||||
explicit CstSortPredicate(ValueEnumerator &ve) : VE(ve) {}
|
||||
bool operator()(const std::pair<const Value*, unsigned> &LHS,
|
||||
const std::pair<const Value*, unsigned> &RHS) {
|
||||
// Sort by plane.
|
||||
if (LHS.first->getType() != RHS.first->getType())
|
||||
return VE.getTypeID(LHS.first->getType()) <
|
||||
VE.getTypeID(RHS.first->getType());
|
||||
// Then by frequency.
|
||||
return LHS.second > RHS.second;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// OptimizeConstants - Reorder constant pool for denser encoding.
|
||||
void ValueEnumerator::OptimizeConstants(unsigned CstStart, unsigned CstEnd) {
|
||||
|
Reference in New Issue
Block a user