Add a comment to some code that at first glance just doesn't look right.
authorReid Spencer <rspencer@reidspencer.com>
Tue, 16 Nov 2004 06:50:36 +0000 (06:50 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Tue, 16 Nov 2004 06:50:36 +0000 (06:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17886 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/CommandLine.cpp

index 15fd19591a00bdaa847ab19652cd81866ba2f5ce..df321653e6d6285cc76604501445ae7b71758125 100644 (file)
@@ -972,5 +972,11 @@ VersOp("version", cl::desc("display the version"),
 
 // Utility function for printing the help message.
 void cl::PrintHelpMessage() {
+  // This looks weird, but it actually prints the help message. The 
+  // NormalPrinter variable is a HelpPrinter and the help gets printed when
+  // its operator= is invoked. That's because the "normal" usages of the
+  // help printer is to be assigned true/false depending on whether the 
+  // --help option was given or not. Since we're circumventing that we have
+  // to make it look like --help was given, so we assign true.
   NormalPrinter = true;
 }