[llvm-commits] CVS: llvm/lib/Support/CommandLine.cpp

Chris Lattner sabre at nondot.org
Thu Oct 12 15:09:31 PDT 2006



Changes in directory llvm/lib/Support:

CommandLine.cpp updated: 1.76 -> 1.77
---
Log message:

shrink anon-ns and mark stuff static.  No functionality changes


---
Diffs of the changes:  (+11 -10)

 CommandLine.cpp |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)


Index: llvm/lib/Support/CommandLine.cpp
diff -u llvm/lib/Support/CommandLine.cpp:1.76 llvm/lib/Support/CommandLine.cpp:1.77
--- llvm/lib/Support/CommandLine.cpp:1.76	Wed Oct  4 16:50:14 2006
+++ llvm/lib/Support/CommandLine.cpp	Thu Oct 12 17:09:17 2006
@@ -952,23 +952,25 @@
     exit(1);
   }
 };
+} // End anonymous namespace
 
 // Define the two HelpPrinter instances that are used to print out help, or
 // help-hidden...
 //
-HelpPrinter NormalPrinter(false);
-HelpPrinter HiddenPrinter(true);
+static HelpPrinter NormalPrinter(false);
+static HelpPrinter HiddenPrinter(true);
 
-cl::opt<HelpPrinter, true, parser<bool> >
+static cl::opt<HelpPrinter, true, parser<bool> >
 HOp("help", cl::desc("Display available options (--help-hidden for more)"),
     cl::location(NormalPrinter), cl::ValueDisallowed);
 
-cl::opt<HelpPrinter, true, parser<bool> >
+static cl::opt<HelpPrinter, true, parser<bool> >
 HHOp("help-hidden", cl::desc("Display all available options"),
      cl::location(HiddenPrinter), cl::Hidden, cl::ValueDisallowed);
 
-void (*OverrideVersionPrinter)() = 0;
+static void (*OverrideVersionPrinter)() = 0;
 
+namespace {
 class VersionPrinter {
 public:
   void operator=(bool OptionWasSpecified) {
@@ -998,17 +1000,16 @@
     }
   }
 };
+} // End anonymous namespace
 
 
 // Define the --version option that prints out the LLVM version for the tool
-VersionPrinter VersionPrinterInstance;
-cl::opt<VersionPrinter, true, parser<bool> >
+static VersionPrinter VersionPrinterInstance;
+
+static cl::opt<VersionPrinter, true, parser<bool> >
 VersOp("version", cl::desc("Display the version of this program"),
     cl::location(VersionPrinterInstance), cl::ValueDisallowed);
 
-
-} // End anonymous namespace
-
 // Utility function for printing the help message.
 void cl::PrintHelpMessage() {
   // This looks weird, but it actually prints the help message. The






More information about the llvm-commits mailing list