From b29cda9b3c39fbbd53db44dbc5075d5445a98200 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 15 Apr 2010 17:08:50 +0000 Subject: Fix a bunch of namespace polution. llvm-svn: 101376 --- llvm/lib/Support/Debug.cpp | 11 +++++++++-- llvm/lib/Support/Timer.cpp | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Support') diff --git a/llvm/lib/Support/Debug.cpp b/llvm/lib/Support/Debug.cpp index eccfa0bd072..7f48f8aae71 100644 --- a/llvm/lib/Support/Debug.cpp +++ b/llvm/lib/Support/Debug.cpp @@ -51,12 +51,19 @@ DebugBufferSize("debug-buffer-size", cl::init(0)); static std::string CurrentDebugType; -static struct DebugOnlyOpt { + +namespace { + +struct DebugOnlyOpt { void operator=(const std::string &Val) const { DebugFlag |= !Val.empty(); CurrentDebugType = Val; } -} DebugOnlyOptLoc; +}; + +} + +static DebugOnlyOpt DebugOnlyOptLoc; static cl::opt > DebugOnly("debug-only", cl::desc("Enable a specific type of debug output"), diff --git a/llvm/lib/Support/Timer.cpp b/llvm/lib/Support/Timer.cpp index 4fac0737f0c..481f6ba5086 100644 --- a/llvm/lib/Support/Timer.cpp +++ b/llvm/lib/Support/Timer.cpp @@ -190,6 +190,8 @@ void TimeRecord::print(const TimeRecord &Total, raw_ostream &OS) const { // NamedRegionTimer Implementation //===----------------------------------------------------------------------===// +namespace { + typedef StringMap Name2TimerMap; class Name2PairMap { @@ -216,6 +218,8 @@ public: } }; +} + static ManagedStatic NamedTimers; static ManagedStatic NamedGroupedTimers; -- cgit v1.2.3