diff options
| author | Dan Gohman <gohman@apple.com> | 2008-05-13 00:00:25 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-05-13 00:00:25 +0000 |
| commit | d78c400b5bfb7904769b0ef9d259c7bb2573d8f8 (patch) | |
| tree | ce04c5328b5fc48abc5f9b54ba42fdb6649d932b /llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | |
| parent | 80ff5f06963070b10a3e9de0cc6946a7bed132c8 (diff) | |
| download | bcm5719-llvm-d78c400b5bfb7904769b0ef9d259c7bb2573d8f8.tar.gz bcm5719-llvm-d78c400b5bfb7904769b0ef9d259c7bb2573d8f8.zip | |
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.
llvm-svn: 51017
Diffstat (limited to 'llvm/lib/Bitcode/Writer/ValueEnumerator.cpp')
| -rw-r--r-- | llvm/lib/Bitcode/Writer/ValueEnumerator.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp index 09a1db3d628..92271ce2b91 100644 --- a/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp +++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp @@ -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) { |

