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/CodeGen/LiveIntervalAnalysis.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/CodeGen/LiveIntervalAnalysis.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/LiveIntervalAnalysis.cpp | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp index 87c854bd027..8b25344b477 100644 --- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -36,16 +36,14 @@ #include <cmath> using namespace llvm; -namespace { - // Hidden options for help debugging. - static cl::opt<bool> DisableReMat("disable-rematerialization", - cl::init(false), cl::Hidden); - - static cl::opt<bool> SplitAtBB("split-intervals-at-bb", - cl::init(true), cl::Hidden); - static cl::opt<int> SplitLimit("split-limit", - cl::init(-1), cl::Hidden); -} +// Hidden options for help debugging. +static cl::opt<bool> DisableReMat("disable-rematerialization", + cl::init(false), cl::Hidden); + +static cl::opt<bool> SplitAtBB("split-intervals-at-bb", + cl::init(true), cl::Hidden); +static cl::opt<int> SplitLimit("split-limit", + cl::init(-1), cl::Hidden); STATISTIC(numIntervals, "Number of original intervals"); STATISTIC(numIntervalsAfter, "Number of intervals after coalescing"); @@ -53,9 +51,7 @@ STATISTIC(numFolds , "Number of loads/stores folded into instructions"); STATISTIC(numSplits , "Number of intervals split"); char LiveIntervals::ID = 0; -namespace { - RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis"); -} +static RegisterPass<LiveIntervals> X("liveintervals", "Live Interval Analysis"); void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved<LiveVariables>(); @@ -1078,20 +1074,22 @@ static const VNInfo *findDefinedVNInfo(const LiveInterval &li, unsigned DefIdx) /// RewriteInfo - Keep track of machine instrs that will be rewritten /// during spilling. -struct RewriteInfo { - unsigned Index; - MachineInstr *MI; - bool HasUse; - bool HasDef; - RewriteInfo(unsigned i, MachineInstr *mi, bool u, bool d) - : Index(i), MI(mi), HasUse(u), HasDef(d) {} -}; - -struct RewriteInfoCompare { - bool operator()(const RewriteInfo &LHS, const RewriteInfo &RHS) const { - return LHS.Index < RHS.Index; - } -}; +namespace { + struct RewriteInfo { + unsigned Index; + MachineInstr *MI; + bool HasUse; + bool HasDef; + RewriteInfo(unsigned i, MachineInstr *mi, bool u, bool d) + : Index(i), MI(mi), HasUse(u), HasDef(d) {} + }; + + struct RewriteInfoCompare { + bool operator()(const RewriteInfo &LHS, const RewriteInfo &RHS) const { + return LHS.Index < RHS.Index; + } + }; +} void LiveIntervals:: rewriteInstructionsForSpills(const LiveInterval &li, bool TrySplit, |

