summaryrefslogtreecommitdiff
path: root/lib/Analysis
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
commit844731a7f1909f55935e3514c9e713a62d67662e (patch)
tree9221560124d6ed762ef6e5bbda45f4038dacdeb0 /lib/Analysis
parenta334d5f5355be5c26ea2d3c28456722afd1a4559 (diff)
downloadllvm-844731a7f1909f55935e3514c9e713a62d67662e.tar.gz
llvm-844731a7f1909f55935e3514c9e713a62d67662e.tar.bz2
llvm-844731a7f1909f55935e3514c9e713a62d67662e.tar.xz
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/Analysis')
-rw-r--r--lib/Analysis/AliasAnalysis.cpp4
-rw-r--r--lib/Analysis/AliasAnalysisCounter.cpp20
-rw-r--r--lib/Analysis/AliasAnalysisEvaluator.cpp27
-rw-r--r--lib/Analysis/AliasDebugger.cpp9
-rw-r--r--lib/Analysis/AliasSetTracker.cpp6
-rw-r--r--lib/Analysis/BasicAliasAnalysis.cpp28
-rw-r--r--lib/Analysis/CFGPrinter.cpp35
-rw-r--r--lib/Analysis/IPA/Andersens.cpp29
-rw-r--r--lib/Analysis/IPA/CallGraph.cpp9
-rw-r--r--lib/Analysis/IPA/CallGraphSCCPass.cpp4
-rw-r--r--lib/Analysis/IPA/GlobalsModRef.cpp11
-rw-r--r--lib/Analysis/InstCount.cpp8
-rw-r--r--lib/Analysis/LoadValueNumbering.cpp13
-rw-r--r--lib/Analysis/MemoryDependenceAnalysis.cpp14
-rw-r--r--lib/Analysis/ProfileInfo.cpp18
-rw-r--r--lib/Analysis/ProfileInfoLoaderPass.cpp20
-rw-r--r--lib/Analysis/ScalarEvolution.cpp8
-rw-r--r--lib/Analysis/ValueNumbering.cpp16
18 files changed, 143 insertions, 136 deletions
diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp
index 04ad7de7bd..be42f749b4 100644
--- a/lib/Analysis/AliasAnalysis.cpp
+++ b/lib/Analysis/AliasAnalysis.cpp
@@ -34,9 +34,7 @@
using namespace llvm;
// Register the AliasAnalysis interface, providing a nice name to refer to.
-namespace {
- RegisterAnalysisGroup<AliasAnalysis> Z("Alias Analysis");
-}
+static RegisterAnalysisGroup<AliasAnalysis> Z("Alias Analysis");
char AliasAnalysis::ID = 0;
//===----------------------------------------------------------------------===//
diff --git a/lib/Analysis/AliasAnalysisCounter.cpp b/lib/Analysis/AliasAnalysisCounter.cpp
index 9c42902a04..48f00ad222 100644
--- a/lib/Analysis/AliasAnalysisCounter.cpp
+++ b/lib/Analysis/AliasAnalysisCounter.cpp
@@ -21,12 +21,12 @@
#include "llvm/Support/Streams.h"
using namespace llvm;
-namespace {
- static cl::opt<bool>
- PrintAll("count-aa-print-all-queries", cl::ReallyHidden);
- static cl::opt<bool>
- PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden);
+static cl::opt<bool>
+PrintAll("count-aa-print-all-queries", cl::ReallyHidden);
+static cl::opt<bool>
+PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden);
+namespace {
class VISIBILITY_HIDDEN AliasAnalysisCounter
: public ModulePass, public AliasAnalysis {
unsigned No, May, Must;
@@ -113,13 +113,13 @@ namespace {
return AliasAnalysis::getModRefInfo(CS1,CS2);
}
};
-
- char AliasAnalysisCounter::ID = 0;
- RegisterPass<AliasAnalysisCounter>
- X("count-aa", "Count Alias Analysis Query Responses", false, true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
+char AliasAnalysisCounter::ID = 0;
+static RegisterPass<AliasAnalysisCounter>
+X("count-aa", "Count Alias Analysis Query Responses", false, true);
+static RegisterAnalysisGroup<AliasAnalysis> Y(X);
+
ModulePass *llvm::createAliasAnalysisCounterPass() {
return new AliasAnalysisCounter();
}
diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp
index 704ab8273c..af15d0f4ad 100644
--- a/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/lib/Analysis/AliasAnalysisEvaluator.cpp
@@ -34,19 +34,18 @@
#include <sstream>
using namespace llvm;
-namespace {
- static cl::opt<bool>
- PrintAll("print-all-alias-modref-info", cl::ReallyHidden);
+static cl::opt<bool> PrintAll("print-all-alias-modref-info", cl::ReallyHidden);
- static cl::opt<bool> PrintNoAlias("print-no-aliases", cl::ReallyHidden);
- static cl::opt<bool> PrintMayAlias("print-may-aliases", cl::ReallyHidden);
- static cl::opt<bool> PrintMustAlias("print-must-aliases", cl::ReallyHidden);
+static cl::opt<bool> PrintNoAlias("print-no-aliases", cl::ReallyHidden);
+static cl::opt<bool> PrintMayAlias("print-may-aliases", cl::ReallyHidden);
+static cl::opt<bool> PrintMustAlias("print-must-aliases", cl::ReallyHidden);
- static cl::opt<bool> PrintNoModRef("print-no-modref", cl::ReallyHidden);
- static cl::opt<bool> PrintMod("print-mod", cl::ReallyHidden);
- static cl::opt<bool> PrintRef("print-ref", cl::ReallyHidden);
- static cl::opt<bool> PrintModRef("print-modref", cl::ReallyHidden);
+static cl::opt<bool> PrintNoModRef("print-no-modref", cl::ReallyHidden);
+static cl::opt<bool> PrintMod("print-mod", cl::ReallyHidden);
+static cl::opt<bool> PrintRef("print-ref", cl::ReallyHidden);
+static cl::opt<bool> PrintModRef("print-modref", cl::ReallyHidden);
+namespace {
class VISIBILITY_HIDDEN AAEval : public FunctionPass {
unsigned NoAlias, MayAlias, MustAlias;
unsigned NoModRef, Mod, Ref, ModRef;
@@ -74,12 +73,12 @@ namespace {
bool runOnFunction(Function &F);
bool doFinalization(Module &M);
};
-
- char AAEval::ID = 0;
- static RegisterPass<AAEval>
- X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true);
}
+char AAEval::ID = 0;
+static RegisterPass<AAEval>
+X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true);
+
FunctionPass *llvm::createAAEvalPass() { return new AAEval(); }
static void PrintResults(const char *Msg, bool P, const Value *V1, const Value *V2,
diff --git a/lib/Analysis/AliasDebugger.cpp b/lib/Analysis/AliasDebugger.cpp
index 491c4b091e..06a43b11dd 100644
--- a/lib/Analysis/AliasDebugger.cpp
+++ b/lib/Analysis/AliasDebugger.cpp
@@ -121,11 +121,12 @@ namespace {
}
};
-
- char AliasDebugger::ID = 0;
- RegisterPass<AliasDebugger> X("debug-aa", "AA use debugger", false, true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
+char AliasDebugger::ID = 0;
+static RegisterPass<AliasDebugger>
+X("debug-aa", "AA use debugger", false, true);
+static RegisterAnalysisGroup<AliasAnalysis> Y(X);
+
Pass *llvm::createAliasDebugger() { return new AliasDebugger(); }
diff --git a/lib/Analysis/AliasSetTracker.cpp b/lib/Analysis/AliasSetTracker.cpp
index 01e700b768..68603e53b6 100644
--- a/lib/Analysis/AliasSetTracker.cpp
+++ b/lib/Analysis/AliasSetTracker.cpp
@@ -585,6 +585,8 @@ namespace {
return false;
}
};
- char AliasSetPrinter::ID = 0;
- RegisterPass<AliasSetPrinter> X("print-alias-sets", "Alias Set Printer", false, true);
}
+
+char AliasSetPrinter::ID = 0;
+static RegisterPass<AliasSetPrinter>
+X("print-alias-sets", "Alias Set Printer", false, true);
diff --git a/lib/Analysis/BasicAliasAnalysis.cpp b/lib/Analysis/BasicAliasAnalysis.cpp
index 97dd56aa03..21108c6453 100644
--- a/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/lib/Analysis/BasicAliasAnalysis.cpp
@@ -79,15 +79,15 @@ namespace {
virtual void deleteValue(Value *V) {}
virtual void copyValue(Value *From, Value *To) {}
};
+} // End of anonymous namespace
- // Register this pass...
- char NoAA::ID = 0;
- RegisterPass<NoAA>
- U("no-aa", "No Alias Analysis (always returns 'may' alias)", true, true);
+// Register this pass...
+char NoAA::ID = 0;
+static RegisterPass<NoAA>
+U("no-aa", "No Alias Analysis (always returns 'may' alias)", true, true);
- // Declare that we implement the AliasAnalysis interface
- RegisterAnalysisGroup<AliasAnalysis> V(U);
-} // End of anonymous namespace
+// Declare that we implement the AliasAnalysis interface
+static RegisterAnalysisGroup<AliasAnalysis> V(U);
ImmutablePass *llvm::createNoAAPass() { return new NoAA(); }
@@ -124,15 +124,15 @@ namespace {
const Type *BasePtr2Ty,
Value **GEP2Ops, unsigned NumGEP2Ops, unsigned G2Size);
};
+} // End of anonymous namespace
- // Register this pass...
- char BasicAliasAnalysis::ID = 0;
- RegisterPass<BasicAliasAnalysis>
- X("basicaa", "Basic Alias Analysis (default AA impl)", false, true);
+// Register this pass...
+char BasicAliasAnalysis::ID = 0;
+static RegisterPass<BasicAliasAnalysis>
+X("basicaa", "Basic Alias Analysis (default AA impl)", false, true);
- // Declare that we implement the AliasAnalysis interface
- RegisterAnalysisGroup<AliasAnalysis, true> Y(X);
-} // End of anonymous namespace
+// Declare that we implement the AliasAnalysis interface
+static RegisterAnalysisGroup<AliasAnalysis, true> Y(X);
ImmutablePass *llvm::createBasicAliasAnalysisPass() {
return new BasicAliasAnalysis();
diff --git a/lib/Analysis/CFGPrinter.cpp b/lib/Analysis/CFGPrinter.cpp
index f293555a69..e20a0a2f87 100644
--- a/lib/Analysis/CFGPrinter.cpp
+++ b/lib/Analysis/CFGPrinter.cpp
@@ -105,11 +105,13 @@ namespace {
AU.setPreservesAll();
}
};
+}
- char CFGViewer::ID = 0;
- RegisterPass<CFGViewer> V0("view-cfg",
- "View CFG of function", false, true);
+char CFGViewer::ID = 0;
+static RegisterPass<CFGViewer>
+V0("view-cfg", "View CFG of function", false, true);
+namespace {
struct VISIBILITY_HIDDEN CFGOnlyViewer : public FunctionPass {
static char ID; // Pass identifcation, replacement for typeid
CFGOnlyViewer() : FunctionPass((intptr_t)&ID) {}
@@ -127,11 +129,14 @@ namespace {
AU.setPreservesAll();
}
};
+}
- char CFGOnlyViewer::ID = 0;
- RegisterPass<CFGOnlyViewer> V1("view-cfg-only",
- "View CFG of function (with no function bodies)", false, true);
+char CFGOnlyViewer::ID = 0;
+static RegisterPass<CFGOnlyViewer>
+V1("view-cfg-only",
+ "View CFG of function (with no function bodies)", false, true);
+namespace {
struct VISIBILITY_HIDDEN CFGPrinter : public FunctionPass {
static char ID; // Pass identification, replacement for typeid
CFGPrinter() : FunctionPass((intptr_t)&ID) {}
@@ -156,11 +161,13 @@ namespace {
AU.setPreservesAll();
}
};
+}
- char CFGPrinter::ID = 0;
- RegisterPass<CFGPrinter> P1("print-cfg",
- "Print CFG of function to 'dot' file", false, true);
+char CFGPrinter::ID = 0;
+static RegisterPass<CFGPrinter>
+P1("print-cfg", "Print CFG of function to 'dot' file", false, true);
+namespace {
struct VISIBILITY_HIDDEN CFGOnlyPrinter : public CFGPrinter {
static char ID; // Pass identification, replacement for typeid
CFGOnlyPrinter() : CFGPrinter((intptr_t)&ID) {}
@@ -177,13 +184,13 @@ namespace {
AU.setPreservesAll();
}
};
-
- char CFGOnlyPrinter::ID = 0;
- RegisterPass<CFGOnlyPrinter>
- P2("print-cfg-only",
- "Print CFG of function to 'dot' file (with no function bodies)", false, true);
}
+char CFGOnlyPrinter::ID = 0;
+static RegisterPass<CFGOnlyPrinter>
+P2("print-cfg-only",
+ "Print CFG of function to 'dot' file (with no function bodies)", false, true);
+
/// viewCFG - This function is meant for use from the debugger. You can just
/// say 'call F->viewCFG()' and a ghostview window should pop up from the
/// program, displaying the CFG of the current function. This depends on there
diff --git a/lib/Analysis/IPA/Andersens.cpp b/lib/Analysis/IPA/Andersens.cpp
index ab80bab95c..823a32f85f 100644
--- a/lib/Analysis/IPA/Andersens.cpp
+++ b/lib/Analysis/IPA/Andersens.cpp
@@ -89,14 +89,14 @@ STATISTIC(NumNodes , "Number of nodes");
STATISTIC(NumUnified , "Number of variables unified");
STATISTIC(NumErased , "Number of redundant constraints erased");
-namespace {
- const unsigned SelfRep = (unsigned)-1;
- const unsigned Unvisited = (unsigned)-1;
- // Position of the function return node relative to the function node.
- const unsigned CallReturnPos = 1;
- // Position of the function call node relative to the function node.
- const unsigned CallFirstArgPos = 2;
+static const unsigned SelfRep = (unsigned)-1;
+static const unsigned Unvisited = (unsigned)-1;
+// Position of the function return node relative to the function node.
+static const unsigned CallReturnPos = 1;
+// Position of the function call node relative to the function node.
+static const unsigned CallFirstArgPos = 2;
+namespace {
struct BitmapKeyInfo {
static inline SparseBitVector<> *getEmptyKey() {
return reinterpret_cast<SparseBitVector<> *>(-1);
@@ -608,16 +608,15 @@ namespace {
PrintPointsToGraph();
}
};
+}
- char Andersens::ID = 0;
- RegisterPass<Andersens> X("anders-aa",
- "Andersen's Interprocedural Alias Analysis", false,
- true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
+char Andersens::ID = 0;
+static RegisterPass<Andersens>
+X("anders-aa", "Andersen's Interprocedural Alias Analysis", false, true);
+static RegisterAnalysisGroup<AliasAnalysis> Y(X);
- // Initialize Timestamp Counter (static).
- unsigned Andersens::Node::Counter = 0;
-}
+// Initialize Timestamp Counter (static).
+unsigned Andersens::Node::Counter = 0;
ModulePass *llvm::createAndersensPass() { return new Andersens(); }
diff --git a/lib/Analysis/IPA/CallGraph.cpp b/lib/Analysis/IPA/CallGraph.cpp
index f0dd1880ff..eaa0d0181a 100644
--- a/lib/Analysis/IPA/CallGraph.cpp
+++ b/lib/Analysis/IPA/CallGraph.cpp
@@ -190,12 +190,13 @@ private:
}
};
-RegisterAnalysisGroup<CallGraph> X("Call Graph");
-RegisterPass<BasicCallGraph> Y("basiccg", "Basic CallGraph Construction", false, true);
-RegisterAnalysisGroup<CallGraph, true> Z(Y);
-
} //End anonymous namespace
+static RegisterAnalysisGroup<CallGraph> X("Call Graph");
+static RegisterPass<BasicCallGraph>
+Y("basiccg", "Basic CallGraph Construction", false, true);
+static RegisterAnalysisGroup<CallGraph, true> Z(Y);
+
char CallGraph::ID = 0;
char BasicCallGraph::ID = 0;
diff --git a/lib/Analysis/IPA/CallGraphSCCPass.cpp b/lib/Analysis/IPA/CallGraphSCCPass.cpp
index 99954d632d..112f9c2e5d 100644
--- a/lib/Analysis/IPA/CallGraphSCCPass.cpp
+++ b/lib/Analysis/IPA/CallGraphSCCPass.cpp
@@ -27,6 +27,8 @@ using namespace llvm;
//
/// CGPassManager manages FPPassManagers and CalLGraphSCCPasses.
+namespace {
+
class CGPassManager : public ModulePass, public PMDataManager {
public:
@@ -73,6 +75,8 @@ public:
}
};
+}
+
char CGPassManager::ID = 0;
/// run - Execute all of the passes scheduled for execution. Keep track of
/// whether any of the passes modifies the module, and if so, return true.
diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp
index 6ce320964e..6d6282029a 100644
--- a/lib/Analysis/IPA/GlobalsModRef.cpp
+++ b/lib/Analysis/IPA/GlobalsModRef.cpp
@@ -146,14 +146,13 @@ namespace {
GlobalValue *OkayStoreDest = 0);
bool AnalyzeIndirectGlobalMemory(GlobalValue *GV);
};
-
- char GlobalsModRef::ID = 0;
- RegisterPass<GlobalsModRef> X("globalsmodref-aa",
- "Simple mod/ref analysis for globals", false,
- true);
- RegisterAnalysisGroup<AliasAnalysis> Y(X);
}
+char GlobalsModRef::ID = 0;
+static RegisterPass<GlobalsModRef>
+X("globalsmodref-aa", "Simple mod/ref analysis for globals", false, true);
+static RegisterAnalysisGroup<AliasAnalysis> Y(X);
+
Pass *llvm::createGlobalsModRefPass() { return new GlobalsModRef(); }
/// getUnderlyingObject - This traverses the use chain to figure out what object
diff --git a/lib/Analysis/InstCount.cpp b/lib/Analysis/InstCount.cpp
index c4f36d3874..5f33a60e6f 100644
--- a/lib/Analysis/InstCount.cpp
+++ b/lib/Analysis/InstCount.cpp
@@ -62,12 +62,12 @@ namespace {
virtual void print(std::ostream &O, const Module *M) const {}
};
-
- char InstCount::ID = 0;
- RegisterPass<InstCount> X("instcount",
- "Counts the various types of Instructions", false, true);
}
+char InstCount::ID = 0;
+static RegisterPass<InstCount>
+X("instcount", "Counts the various types of Instructions", false, true);
+
FunctionPass *llvm::createInstCountPass() { return new InstCount(); }
// InstCount::run - This is the main Analysis entry point for a
diff --git a/lib/Analysis/LoadValueNumbering.cpp b/lib/Analysis/LoadValueNumbering.cpp
index bbb1e1e1b0..0317ddbc91 100644
--- a/lib/Analysis/LoadValueNumbering.cpp
+++ b/lib/Analysis/LoadValueNumbering.cpp
@@ -82,14 +82,15 @@ namespace {
void getCallEqualNumberNodes(CallInst *CI,
std::vector<Value*> &RetVals) const;
};
+}
- char LoadVN::ID = 0;
- // Register this pass...
- RegisterPass<LoadVN> X("load-vn", "Load Value Numbering", false, true);
+char LoadVN::ID = 0;
+// Register this pass...
+static RegisterPass<LoadVN>
+X("load-vn", "Load Value Numbering", false, true);
- // Declare that we implement the ValueNumbering interface
- RegisterAnalysisGroup<ValueNumbering> Y(X);
-}
+// Declare that we implement the ValueNumbering interface
+static RegisterAnalysisGroup<ValueNumbering> Y(X);
FunctionPass *llvm::createLoadValueNumberingPass() { return new LoadVN(); }
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index 8a59c3a743..4af7b42fb7 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -28,14 +28,12 @@
using namespace llvm;
-namespace {
- // Control the calculation of non-local dependencies by only examining the
- // predecessors if the basic block has less than X amount (50 by default).
- static cl::opt<int>
- PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50),
- cl::desc("Control the calculation of non-local"
- "dependencies (default = 50)"));
-}
+// Control the calculation of non-local dependencies by only examining the
+// predecessors if the basic block has less than X amount (50 by default).
+static cl::opt<int>
+PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50),
+ cl::desc("Control the calculation of non-local"
+ "dependencies (default = 50)"));
STATISTIC(NumCacheNonlocal, "Number of cached non-local responses");
STATISTIC(NumUncacheNonlocal, "Number of uncached non-local responses");
diff --git a/lib/Analysis/ProfileInfo.cpp b/lib/Analysis/ProfileInfo.cpp
index 2ee398d1aa..047491baee 100644
--- a/lib/Analysis/ProfileInfo.cpp
+++ b/lib/Analysis/ProfileInfo.cpp
@@ -21,9 +21,7 @@
using namespace llvm;
// Register the ProfileInfo interface, providing a nice name to refer to.
-namespace {
- RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
-}
+static RegisterAnalysisGroup<ProfileInfo> Z("Profile Information");
char ProfileInfo::ID = 0;
ProfileInfo::~ProfileInfo() {}
@@ -89,14 +87,14 @@ namespace {
static char ID; // Class identification, replacement for typeinfo
NoProfileInfo() : ImmutablePass((intptr_t)&ID) {}
};
+} // End of anonymous namespace
- char NoProfileInfo::ID = 0;
- // Register this pass...
- RegisterPass<NoProfileInfo>
- X("no-profile", "No Profile Information", false, true);
+char NoProfileInfo::ID = 0;
+// Register this pass...
+static RegisterPass<NoProfileInfo>
+X("no-profile", "No Profile Information", false, true);
- // Declare that we implement the ProfileInfo interface
- RegisterAnalysisGroup<ProfileInfo, true> Y(X);
-} // End of anonymous namespace
+// Declare that we implement the ProfileInfo interface
+static RegisterAnalysisGroup<ProfileInfo, true> Y(X);
ImmutablePass *llvm::createNoProfileInfoPass() { return new NoProfileInfo(); }
diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp
index e7612e1d82..b2fa9e45e7 100644
--- a/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/lib/Analysis/ProfileInfoLoaderPass.cpp
@@ -23,12 +23,12 @@
#include "llvm/Support/Streams.h"
using namespace llvm;
-namespace {
- static cl::opt<std::string>
- ProfileInfoFilename("profile-info-file", cl::init("llvmprof.out"),
- cl::value_desc("filename"),
- cl::desc("Profile file loaded by -profile-loader"));
+static cl::opt<std::string>
+ProfileInfoFilename("profile-info-file", cl::init("llvmprof.out"),
+ cl::value_desc("filename"),
+ cl::desc("Profile file loaded by -profile-loader"));
+namespace {
class VISIBILITY_HIDDEN LoaderPass : public ModulePass, public ProfileInfo {
std::string Filename;
public:
@@ -49,13 +49,13 @@ namespace {
/// run - Load the profile information from the specified file.
virtual bool runOnModule(Module &M);
};
+} // End of anonymous namespace
- char LoaderPass::ID = 0;
- RegisterPass<LoaderPass>
- X("profile-loader", "Load profile information from llvmprof.out", false, true);
+char LoaderPass::ID = 0;
+static RegisterPass<LoaderPass>
+X("profile-loader", "Load profile information from llvmprof.out", false, true);
- RegisterAnalysisGroup<ProfileInfo> Y(X);
-} // End of anonymous namespace
+static RegisterAnalysisGroup<ProfileInfo> Y(X);
ModulePass *llvm::createProfileLoaderPass() { return new LoaderPass(); }
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index b757531bc1..26010ebaa2 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -95,16 +95,14 @@ STATISTIC(NumTripCountsNotComputed,
STATISTIC(NumBruteForceTripCountsComputed,
"Number of loops with trip counts computed by force");
-cl::opt<unsigned>
+static cl::opt<unsigned>
MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
cl::desc("Maximum number of iterations SCEV will "
"symbolically execute a constant derived loop"),
cl::init(100));
-namespace {
- RegisterPass<ScalarEvolution>
- R("scalar-evolution", "Scalar Evolution Analysis", false, true);
-}
+static RegisterPass<ScalarEvolution>
+R("scalar-evolution", "Scalar Evolution Analysis", false, true);
char ScalarEvolution::ID = 0;
//===----------------------------------------------------------------------===//
diff --git a/lib/Analysis/ValueNumbering.cpp b/lib/Analysis/ValueNumbering.cpp
index 6c3ffdf224..1e4b306f62 100644
--- a/lib/Analysis/ValueNumbering.cpp
+++ b/lib/Analysis/ValueNumbering.cpp
@@ -24,7 +24,7 @@ using namespace llvm;
char ValueNumbering::ID = 0;
// Register the ValueNumbering interface, providing a nice name to refer to.
-static RegisterAnalysisGroup<ValueNumbering> X("Value Numbering");
+static RegisterAnalysisGroup<ValueNumbering> V("Value Numbering");
/// ValueNumbering destructor: DO NOT move this to the header file for
/// ValueNumbering or else clients of the ValueNumbering class may not depend on
@@ -64,15 +64,17 @@ namespace {
virtual void getEqualNumberNodes(Value *V1,
std::vector<Value*> &RetVals) const;
};
+}
- char BasicVN::ID = 0;
- // Register this pass...
- RegisterPass<BasicVN>
- X("basicvn", "Basic Value Numbering (default GVN impl)", false, true);
+char BasicVN::ID = 0;
+// Register this pass...
+static RegisterPass<BasicVN>
+X("basicvn", "Basic Value Numbering (default GVN impl)", false, true);
- // Declare that we implement the ValueNumbering interface
- RegisterAnalysisGroup<ValueNumbering, true> Y(X);
+// Declare that we implement the ValueNumbering interface
+static RegisterAnalysisGroup<ValueNumbering, true> Y(X);
+namespace {
/// BVNImpl - Implement BasicVN in terms of a visitor class that
/// handles the different types of instructions as appropriate.
///