From 089efffd7d1ca0d10522ace38d36e0a67f4fac2d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 13 May 2008 00:00:25 +0000 Subject: 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 --- lib/CodeGen/LiveIntervalAnalysis.cpp | 52 +++++++++++++++++------------------- 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'lib/CodeGen/LiveIntervalAnalysis.cpp') diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp index 87c854b..8b25344 100644 --- a/lib/CodeGen/LiveIntervalAnalysis.cpp +++ b/lib/CodeGen/LiveIntervalAnalysis.cpp @@ -36,16 +36,14 @@ #include using namespace llvm; -namespace { - // Hidden options for help debugging. - static cl::opt DisableReMat("disable-rematerialization", - cl::init(false), cl::Hidden); - - static cl::opt SplitAtBB("split-intervals-at-bb", - cl::init(true), cl::Hidden); - static cl::opt SplitLimit("split-limit", - cl::init(-1), cl::Hidden); -} +// Hidden options for help debugging. +static cl::opt DisableReMat("disable-rematerialization", + cl::init(false), cl::Hidden); + +static cl::opt SplitAtBB("split-intervals-at-bb", + cl::init(true), cl::Hidden); +static cl::opt 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 X("liveintervals", "Live Interval Analysis"); -} +static RegisterPass X("liveintervals", "Live Interval Analysis"); void LiveIntervals::getAnalysisUsage(AnalysisUsage &AU) const { AU.addPreserved(); @@ -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, -- cgit v1.1