Make several variable declarations static.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50696 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Analysis/AliasAnalysisCounter.cpp b/lib/Analysis/AliasAnalysisCounter.cpp
index 99b1766..9c42902 100644
--- a/lib/Analysis/AliasAnalysisCounter.cpp
+++ b/lib/Analysis/AliasAnalysisCounter.cpp
@@ -22,9 +22,9 @@
 using namespace llvm;
 
 namespace {
-  cl::opt<bool>
+  static cl::opt<bool>
   PrintAll("count-aa-print-all-queries", cl::ReallyHidden);
-  cl::opt<bool>
+  static cl::opt<bool>
   PrintAllFailures("count-aa-print-all-failed-queries", cl::ReallyHidden);
 
   class VISIBILITY_HIDDEN AliasAnalysisCounter 
diff --git a/lib/Analysis/AliasAnalysisEvaluator.cpp b/lib/Analysis/AliasAnalysisEvaluator.cpp
index c986554..704ab82 100644
--- a/lib/Analysis/AliasAnalysisEvaluator.cpp
+++ b/lib/Analysis/AliasAnalysisEvaluator.cpp
@@ -35,16 +35,17 @@
 using namespace llvm;
 
 namespace {
-  cl::opt<bool> PrintAll("print-all-alias-modref-info", cl::ReallyHidden);
+  static cl::opt<bool>
+  PrintAll("print-all-alias-modref-info", cl::ReallyHidden);
 
-  cl::opt<bool> PrintNoAlias("print-no-aliases", cl::ReallyHidden);
-  cl::opt<bool> PrintMayAlias("print-may-aliases", cl::ReallyHidden);
-  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);
 
-  cl::opt<bool> PrintNoModRef("print-no-modref", cl::ReallyHidden);
-  cl::opt<bool> PrintMod("print-mod", cl::ReallyHidden);
-  cl::opt<bool> PrintRef("print-ref", cl::ReallyHidden);
-  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);
 
   class VISIBILITY_HIDDEN AAEval : public FunctionPass {
     unsigned NoAlias, MayAlias, MustAlias;
@@ -75,7 +76,7 @@
   };
 
   char AAEval::ID = 0;
-  RegisterPass<AAEval>
+  static RegisterPass<AAEval>
   X("aa-eval", "Exhaustive Alias Analysis Precision Evaluator", false, true);
 }
 
diff --git a/lib/Analysis/MemoryDependenceAnalysis.cpp b/lib/Analysis/MemoryDependenceAnalysis.cpp
index 161c2fe..8a59c3a 100644
--- a/lib/Analysis/MemoryDependenceAnalysis.cpp
+++ b/lib/Analysis/MemoryDependenceAnalysis.cpp
@@ -31,7 +31,7 @@
 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).
-  cl::opt<int> 
+  static cl::opt<int> 
   PredLimit("nonlocaldep-threshold", cl::Hidden, cl::init(50),
             cl::desc("Control the calculation of non-local"
                      "dependencies (default = 50)"));           
diff --git a/lib/Analysis/ProfileInfoLoaderPass.cpp b/lib/Analysis/ProfileInfoLoaderPass.cpp
index 07d9682..e7612e1 100644
--- a/lib/Analysis/ProfileInfoLoaderPass.cpp
+++ b/lib/Analysis/ProfileInfoLoaderPass.cpp
@@ -24,7 +24,7 @@
 using namespace llvm;
 
 namespace {
-  cl::opt<std::string>
+  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"));
diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp
index 703addc..0dd31b1 100644
--- a/lib/CodeGen/BranchFolding.cpp
+++ b/lib/CodeGen/BranchFolding.cpp
@@ -40,7 +40,7 @@
                               cl::init(cl::BOU_UNSET), cl::Hidden);
 namespace {
   // Throttle for huge numbers of predecessors (compile speed problems)
-  cl::opt<unsigned>
+  static cl::opt<unsigned>
   TailMergeThreshold("tail-merge-threshold", 
             cl::desc("Max number of predecessors to consider tail merging"),
             cl::init(100), cl::Hidden);
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index d8ca141..87c854b 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -38,13 +38,13 @@
 
 namespace {
   // Hidden options for help debugging.
-  cl::opt<bool> DisableReMat("disable-rematerialization", 
-                              cl::init(false), cl::Hidden);
+  static cl::opt<bool> DisableReMat("disable-rematerialization", 
+                                    cl::init(false), cl::Hidden);
 
-  cl::opt<bool> SplitAtBB("split-intervals-at-bb", 
-                          cl::init(true), cl::Hidden);
-  cl::opt<int> SplitLimit("split-limit",
-                          cl::init(-1), 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");
diff --git a/lib/CodeGen/Passes.cpp b/lib/CodeGen/Passes.cpp
index 6742146..bcd67c50 100644
--- a/lib/CodeGen/Passes.cpp
+++ b/lib/CodeGen/Passes.cpp
@@ -31,6 +31,7 @@
 ///
 //===---------------------------------------------------------------------===//
 namespace {
+  static
   cl::opt<RegisterRegAlloc::FunctionPassCtor, false,
           RegisterPassParser<RegisterRegAlloc> >
   RegAlloc("regalloc",
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 15e3629..8c606b8 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -75,8 +75,8 @@
 ///
 //===---------------------------------------------------------------------===//
 namespace {
-  cl::opt<RegisterScheduler::FunctionPassCtor, false,
-          RegisterPassParser<RegisterScheduler> >
+  static cl::opt<RegisterScheduler::FunctionPassCtor, false,
+                 RegisterPassParser<RegisterScheduler> >
   ISHeuristic("pre-RA-sched",
               cl::init(&createDefaultScheduler),
               cl::desc("Instruction schedulers available (before register"
diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp
index b19066a..1065b09 100644
--- a/lib/Target/TargetMachine.cpp
+++ b/lib/Target/TargetMachine.cpp
@@ -138,13 +138,13 @@
                            cl::location(OptimizeForSize),
                            cl::init(false));
 
-  cl::opt<bool, true>
+  static cl::opt<bool, true>
   EnableRealignStack("realign-stack",
                      cl::desc("Realign stack if needed"),
                      cl::location(RealignStack),
                      cl::init(true));
 
-  cl::opt<unsigned, true>
+  static cl::opt<unsigned, true>
   OverrideStackAlignment("stack-alignment",
                          cl::desc("Override default stack alignment"),
                          cl::location(StackAlignment),
diff --git a/lib/Transforms/IPO/Inliner.cpp b/lib/Transforms/IPO/Inliner.cpp
index cb21b79..f44e784 100644
--- a/lib/Transforms/IPO/Inliner.cpp
+++ b/lib/Transforms/IPO/Inliner.cpp
@@ -31,7 +31,7 @@
 STATISTIC(NumDeleted, "Number of functions deleted because all callers found");
 
 namespace {
-  cl::opt<int>
+  static cl::opt<int>
   InlineLimit("inline-threshold", cl::Hidden, cl::init(200),
         cl::desc("Control the amount of inlining to perform (default = 200)"));
 }
diff --git a/lib/Transforms/IPO/Internalize.cpp b/lib/Transforms/IPO/Internalize.cpp
index d7da798..f3adb56 100644
--- a/lib/Transforms/IPO/Internalize.cpp
+++ b/lib/Transforms/IPO/Internalize.cpp
@@ -32,12 +32,12 @@
 
   // APIFile - A file which contains a list of symbols that should not be marked
   // external.
-  cl::opt<std::string>
+  static cl::opt<std::string>
   APIFile("internalize-public-api-file", cl::value_desc("filename"),
           cl::desc("A file containing list of symbol names to preserve"));
 
   // APIList - A list of symbols that should not be marked internal.
-  cl::list<std::string>
+  static cl::list<std::string>
   APIList("internalize-public-api-list", cl::value_desc("list"),
           cl::desc("A list of symbol names to preserve"),
           cl::CommaSeparated);
diff --git a/lib/Transforms/IPO/LoopExtractor.cpp b/lib/Transforms/IPO/LoopExtractor.cpp
index a2aa4e3..54fc442 100644
--- a/lib/Transforms/IPO/LoopExtractor.cpp
+++ b/lib/Transforms/IPO/LoopExtractor.cpp
@@ -149,7 +149,7 @@
 namespace {
   // BlockFile - A file which contains a list of blocks that should not be
   // extracted.
-  cl::opt<std::string>
+  static cl::opt<std::string>
   BlockFile("extract-blocks-file", cl::value_desc("filename"),
             cl::desc("A file containing list of basic blocks to not extract"),
             cl::Hidden);
diff --git a/lib/Transforms/Instrumentation/RSProfiling.cpp b/lib/Transforms/Instrumentation/RSProfiling.cpp
index 15249c2..c22a29f 100644
--- a/lib/Transforms/Instrumentation/RSProfiling.cpp
+++ b/lib/Transforms/Instrumentation/RSProfiling.cpp
@@ -56,7 +56,7 @@
     GBV, GBVO, HOSTCC
   };
 
-  cl::opt<RandomMeth> RandomMethod("profile-randomness",
+  static cl::opt<RandomMeth> RandomMethod("profile-randomness",
       cl::desc("How to randomly choose to profile:"),
       cl::values(
                  clEnumValN(GBV, "global", "global counter"),
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index 33bfbf0..2d53532 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -59,7 +59,7 @@
 STATISTIC(NumPromoted  , "Number of memory locations promoted to registers");
 
 namespace {
-  cl::opt<bool>
+  static cl::opt<bool>
   DisablePromotion("disable-licm-promotion", cl::Hidden,
                    cl::desc("Disable memory promotion in LICM pass"));
 
diff --git a/lib/Transforms/Scalar/LoopUnroll.cpp b/lib/Transforms/Scalar/LoopUnroll.cpp
index 18acb03..0db9641 100644
--- a/lib/Transforms/Scalar/LoopUnroll.cpp
+++ b/lib/Transforms/Scalar/LoopUnroll.cpp
@@ -45,12 +45,12 @@
 STATISTIC(NumUnrolled,    "Number of loops unrolled (completely or otherwise)");
 
 namespace {
-  cl::opt<unsigned>
+  static cl::opt<unsigned>
   UnrollThreshold
     ("unroll-threshold", cl::init(100), cl::Hidden,
      cl::desc("The cut-off point for automatic loop unrolling"));
 
-  cl::opt<unsigned>
+  static cl::opt<unsigned>
   UnrollCount
     ("unroll-count", cl::init(0), cl::Hidden,
      cl::desc("Use this unroll count for all loops, for testing purposes"));
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp
index 4775123..5af0a57 100644
--- a/lib/Transforms/Scalar/LoopUnswitch.cpp
+++ b/lib/Transforms/Scalar/LoopUnswitch.cpp
@@ -55,7 +55,7 @@
 STATISTIC(NumSimplify, "Number of simplifications of unswitched code");
 
 namespace {
-  cl::opt<unsigned>
+  static cl::opt<unsigned>
   Threshold("loop-unswitch-threshold", cl::desc("Max loop size to unswitch"),
             cl::init(10), cl::Hidden);
   
diff --git a/lib/Transforms/Utils/BasicInliner.cpp b/lib/Transforms/Utils/BasicInliner.cpp
index 59deef5..a3f294d 100644
--- a/lib/Transforms/Utils/BasicInliner.cpp
+++ b/lib/Transforms/Utils/BasicInliner.cpp
@@ -27,7 +27,7 @@
 using namespace llvm;
 
 namespace {
-  cl::opt<unsigned>     
+  static cl::opt<unsigned>     
   BasicInlineThreshold("inline-threshold", cl::Hidden, cl::init(200),
                        cl::desc("Control the amount of basic inlining to perform (default = 200)"));
 }