aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-05-13 00:00:25 +0000
committerDan Gohman <gohman@apple.com>2008-05-13 00:00:25 +0000
commit089efffd7d1ca0d10522ace38d36e0a67f4fac2d (patch)
tree9221560124d6ed762ef6e5bbda45f4038dacdeb0 /lib/Transforms/Instrumentation
parent74d6faf5c9732e3a51e68c58b3fb7d3e9ff8bfb6 (diff)
downloadexternal_llvm-089efffd7d1ca0d10522ace38d36e0a67f4fac2d.zip
external_llvm-089efffd7d1ca0d10522ace38d36e0a67f4fac2d.tar.gz
external_llvm-089efffd7d1ca0d10522ace38d36e0a67f4fac2d.tar.bz2
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
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r--lib/Transforms/Instrumentation/BlockProfiling.cpp22
-rw-r--r--lib/Transforms/Instrumentation/EdgeProfiling.cpp8
-rw-r--r--lib/Transforms/Instrumentation/RSProfiling.cpp35
3 files changed, 35 insertions, 30 deletions
diff --git a/lib/Transforms/Instrumentation/BlockProfiling.cpp b/lib/Transforms/Instrumentation/BlockProfiling.cpp
index 7068db2..acde018 100644
--- a/lib/Transforms/Instrumentation/BlockProfiling.cpp
+++ b/lib/Transforms/Instrumentation/BlockProfiling.cpp
@@ -36,14 +36,14 @@ namespace {
static char ID;
bool runOnModule(Module &M);
};
+}
- char FunctionProfiler::ID = 0;
-
- RegisterPass<FunctionProfiler> X("insert-function-profiling",
- "Insert instrumentation for function profiling");
- RegisterAnalysisGroup<RSProfilers> XG(X);
+char FunctionProfiler::ID = 0;
-}
+static RegisterPass<FunctionProfiler>
+X("insert-function-profiling",
+ "Insert instrumentation for function profiling");
+static RegisterAnalysisGroup<RSProfilers> XG(X);
ModulePass *llvm::createFunctionProfilerPass() {
return new FunctionProfiler();
@@ -86,13 +86,13 @@ namespace {
public:
static char ID;
};
-
- char BlockProfiler::ID = 0;
- RegisterPass<BlockProfiler> Y("insert-block-profiling",
- "Insert instrumentation for block profiling");
- RegisterAnalysisGroup<RSProfilers> YG(Y);
}
+char BlockProfiler::ID = 0;
+static RegisterPass<BlockProfiler>
+Y("insert-block-profiling", "Insert instrumentation for block profiling");
+static RegisterAnalysisGroup<RSProfilers> YG(Y);
+
ModulePass *llvm::createBlockProfilerPass() { return new BlockProfiler(); }
bool BlockProfiler::runOnModule(Module &M) {
diff --git a/lib/Transforms/Instrumentation/EdgeProfiling.cpp b/lib/Transforms/Instrumentation/EdgeProfiling.cpp
index 72f43e5..2cf824b 100644
--- a/lib/Transforms/Instrumentation/EdgeProfiling.cpp
+++ b/lib/Transforms/Instrumentation/EdgeProfiling.cpp
@@ -36,12 +36,12 @@ namespace {
static char ID; // Pass identification, replacement for typeid
EdgeProfiler() : ModulePass((intptr_t)&ID) {}
};
-
- char EdgeProfiler::ID = 0;
- RegisterPass<EdgeProfiler> X("insert-edge-profiling",
- "Insert instrumentation for edge profiling");
}
+char EdgeProfiler::ID = 0;
+static RegisterPass<EdgeProfiler>
+X("insert-edge-profiling", "Insert instrumentation for edge profiling");
+
ModulePass *llvm::createEdgeProfilerPass() { return new EdgeProfiler(); }
bool EdgeProfiler::runOnModule(Module &M) {
diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp
index c22a29f..62c9ddd 100644
--- a/lib/Transforms/Instrumentation/RSProfiling.cpp
+++ b/lib/Transforms/Instrumentation/RSProfiling.cpp
@@ -55,16 +55,18 @@ namespace {
enum RandomMeth {
GBV, GBVO, HOSTCC
};
+}
- static cl::opt<RandomMeth> RandomMethod("profile-randomness",
- cl::desc("How to randomly choose to profile:"),
- cl::values(
- clEnumValN(GBV, "global", "global counter"),
- clEnumValN(GBVO, "ra_global",
- "register allocated global counter"),
- clEnumValN(HOSTCC, "rdcc", "cycle counter"),
- clEnumValEnd));
+static cl::opt<RandomMeth> RandomMethod("profile-randomness",
+ cl::desc("How to randomly choose to profile:"),
+ cl::values(
+ clEnumValN(GBV, "global", "global counter"),
+ clEnumValN(GBVO, "ra_global",
+ "register allocated global counter"),
+ clEnumValN(HOSTCC, "rdcc", "cycle counter"),
+ clEnumValEnd));
+namespace {
/// NullProfilerRS - The basic profiler that does nothing. It is the default
/// profiler and thus terminates RSProfiler chains. It is useful for
/// measuring framework overhead
@@ -81,12 +83,14 @@ namespace {
AU.setPreservesAll();
}
};
+}
- static RegisterAnalysisGroup<RSProfilers> A("Profiling passes");
- static RegisterPass<NullProfilerRS> NP("insert-null-profiling-rs",
- "Measure profiling framework overhead");
- static RegisterAnalysisGroup<RSProfilers, true> NPT(NP);
+static RegisterAnalysisGroup<RSProfilers> A("Profiling passes");
+static RegisterPass<NullProfilerRS> NP("insert-null-profiling-rs",
+ "Measure profiling framework overhead");
+static RegisterAnalysisGroup<RSProfilers, true> NPT(NP);
+namespace {
/// Chooser - Something that chooses when to make a sample of the profiled code
class VISIBILITY_HIDDEN Chooser {
public:
@@ -158,11 +162,12 @@ namespace {
bool doInitialization(Module &M);
virtual void getAnalysisUsage(AnalysisUsage &AU) const;
};
-
- RegisterPass<ProfilerRS> X("insert-rs-profiling-framework",
- "Insert random sampling instrumentation framework");
}
+static RegisterPass<ProfilerRS>
+X("insert-rs-profiling-framework",
+ "Insert random sampling instrumentation framework");
+
char RSProfilers::ID = 0;
char NullProfilerRS::ID = 0;
char ProfilerRS::ID = 0;