Make helper functions/classes/globals static. NFC.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 6 Feb 2015 17:51:54 +0000 (17:51 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 6 Feb 2015 17:51:54 +0000 (17:51 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228410 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/CommandLine.cpp
lib/Target/Mips/MipsFastISel.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/PowerPC/PPCLoopPreIncPrep.cpp
lib/Target/R600/AMDGPUInstrInfo.cpp
lib/Target/X86/X86CallFrameOptimization.cpp
lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
lib/Transforms/Scalar/PlaceSafepoints.cpp

index c8578cb65139fbdb94c365520c38664ff3691cef..7d9f3b7930a484229871f5fca87c42085d5234ce 100644 (file)
@@ -83,6 +83,8 @@ void StringSaver::anchor() {}
 
 //===----------------------------------------------------------------------===//
 
+namespace {
+
 class CommandLineParser {
 public:
   // Globals for name and overview of program.  Program name is not a string to
@@ -190,6 +192,8 @@ public:
   void printOptionValues();
 };
 
+} // namespace
+
 static ManagedStatic<CommandLineParser> GlobalParser;
 
 void cl::AddLiteralOption(Option &O, const char *Name) {
index 7c53095f03cd6d51d1fafb4832c478f17d04542f..a4bf0f3e8bd7e5a05e7d3ee075f9fc4fc1944394 100644 (file)
@@ -186,9 +186,9 @@ static bool CC_MipsO32_FP32(unsigned ValNo, MVT ValVT, MVT LocVT,
   llvm_unreachable("should not be called");
 }
 
-bool CC_MipsO32_FP64(unsigned ValNo, MVT ValVT, MVT LocVT,
-                     CCValAssign::LocInfo LocInfo, ISD::ArgFlagsTy ArgFlags,
-                     CCState &State) {
+static bool CC_MipsO32_FP64(unsigned ValNo, MVT ValVT, MVT LocVT,
+                            CCValAssign::LocInfo LocInfo,
+                            ISD::ArgFlagsTy ArgFlags, CCState &State) {
   llvm_unreachable("should not be called");
 }
 
index b5ca535656855b52a00bc1f6c635bfc94d088fcd..7a8bc28f7a6f1c83718e5f36f25d7805c74986aa 100644 (file)
@@ -42,11 +42,15 @@ using namespace llvm;
 cl::opt<bool> ANDIGlueBug("expose-ppc-andi-glue-bug",
 cl::desc("expose the ANDI glue bug on PPC"), cl::Hidden);
 
-cl::opt<bool> UseBitPermRewriter("ppc-use-bit-perm-rewriter", cl::init(true),
-  cl::desc("use aggressive ppc isel for bit permutations"), cl::Hidden);
-cl::opt<bool> BPermRewriterNoMasking("ppc-bit-perm-rewriter-stress-rotates",
-  cl::desc("stress rotate selection in aggressive ppc isel for "
-           "bit permutations"), cl::Hidden);
+static cl::opt<bool>
+    UseBitPermRewriter("ppc-use-bit-perm-rewriter", cl::init(true),
+                       cl::desc("use aggressive ppc isel for bit permutations"),
+                       cl::Hidden);
+static cl::opt<bool> BPermRewriterNoMasking(
+    "ppc-bit-perm-rewriter-stress-rotates",
+    cl::desc("stress rotate selection in aggressive ppc isel for "
+             "bit permutations"),
+    cl::Hidden);
 
 namespace llvm {
   void initializePPCDAGToDAGISelPass(PassRegistry&);
index 1aba58f8af27aeac3e4ebf6573d702dc78568e36..76dbebc47bce8bb471851b6e94ec0a1a2e774c00 100644 (file)
@@ -88,7 +88,7 @@ namespace {
 }
 
 char PPCLoopPreIncPrep::ID = 0;
-const char *name = "Prepare loop for pre-inc. addressing modes";
+static const char *name = "Prepare loop for pre-inc. addressing modes";
 INITIALIZE_PASS_BEGIN(PPCLoopPreIncPrep, DEBUG_TYPE, name, false, false)
 INITIALIZE_PASS_DEPENDENCY(LoopInfoWrapperPass)
 INITIALIZE_PASS_DEPENDENCY(ScalarEvolution)
index 292d2fbaabbba65c78d12c7fb6dcd7c8f947ea8d..f4de2d6ae89f58dc06b4bdacecd572294a2e6a06 100644 (file)
@@ -350,7 +350,7 @@ enum SISubtarget {
   VI = 1
 };
 
-enum SISubtarget AMDGPUSubtargetToSISubtarget(unsigned Gen) {
+static enum SISubtarget AMDGPUSubtargetToSISubtarget(unsigned Gen) {
   switch (Gen) {
   default:
     return SI;
index fae489e77cc06a51b63279ccac31354f67b2bf55..24752a138444e2c48e7256ffa36ef734fc7621da 100644 (file)
@@ -37,9 +37,10 @@ using namespace llvm;
 
 #define DEBUG_TYPE "x86-cf-opt"
 
-cl::opt<bool> NoX86CFOpt("no-x86-call-frame-opt",
-              cl::desc("Avoid optimizing x86 call frames for size"),
-              cl::init(false), cl::Hidden);
+static cl::opt<bool>
+    NoX86CFOpt("no-x86-call-frame-opt",
+               cl::desc("Avoid optimizing x86 call frames for size"),
+               cl::init(false), cl::Hidden);
 
 namespace {
 class X86CallFrameOptimization : public MachineFunctionPass {
index e9b5f7023c3a58c833b3e6e8935b09293d5117a1..809e9ee99c12ecffca5cddd4e4a9c4c8aea90cf9 100644 (file)
 
 using namespace llvm;
 
-cl::opt<unsigned> LoopSizeCutoff("irce-loop-size-cutoff", cl::Hidden,
-                                 cl::init(64));
+static cl::opt<unsigned> LoopSizeCutoff("irce-loop-size-cutoff", cl::Hidden,
+                                        cl::init(64));
 
-cl::opt<bool> PrintChangedLoops("irce-print-changed-loops", cl::Hidden,
-                                cl::init(false));
+static cl::opt<bool> PrintChangedLoops("irce-print-changed-loops", cl::Hidden,
+                                       cl::init(false));
 
 #define DEBUG_TYPE "irce"
 
index a55c1a77f9fd90520535b314fd912acad65027a9..8315d322689ff3688f62fe3135201373a65090bd 100644 (file)
@@ -104,7 +104,7 @@ static cl::opt<bool> SkipCounted("spp-counted", cl::init(true));
 static cl::opt<bool> SplitBackedge("spp-split-backedge", cl::init(false));
 
 // Print tracing output
-cl::opt<bool> TraceLSP("spp-trace", cl::init(false));
+static cl::opt<bool> TraceLSP("spp-trace", cl::init(false));
 
 namespace {