From: Misha Brukman Date: Wed, 9 Feb 2005 22:49:05 +0000 (+0000) Subject: * Use doc_code style for blocks of code X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=1fc9f8ef0c803958b1d943b6caabe481e96b7372;p=oota-llvm.git * Use doc_code style for blocks of code * Convert < to < in
 block
* Use doc_hilite instead of doc_red style
* Put some classes and options in  blocks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20100 91177308-0d34-0410-b5e6-96231b3b80d8
---

diff --git a/docs/CommandLine.html b/docs/CommandLine.html
index 4f749b7feb7..da28beb3840 100644
--- a/docs/CommandLine.html
+++ b/docs/CommandLine.html
@@ -961,6 +961,7 @@ all of these clients (requiring lots of .cpp files to #include
 
 

To do this, set up your .h file with your option, like this for example:

+
 // DebugFlag.h - Get access to the '-debug' command line option
 //
@@ -976,15 +977,15 @@ extern bool DebugFlag;
 // debug build, then the code specified as the option to the macro will be
 // executed.  Otherwise it will not be.  Example:
 //
-// DEBUG(cerr << "Bitset contains: " << Bitset << "\n");
+// DEBUG(std::cerr << "Bitset contains: " << Bitset << "\n");
 //
-#ifdef NDEBUG
+#ifdef NDEBUG
 #define DEBUG(X)
 #else
-#define DEBUG(X) \
-  do { if (DebugFlag) { X; } } while (0)
-#endif
+#define DEBUG(X) do { if (DebugFlag) { X; } } while (0)
+#endif
 
+

This allows clients to blissfully use the DEBUG() macro, or the DebugFlag explicitly if they want to. Now we just need to be able to @@ -993,18 +994,19 @@ an additial argument to our command line argument processor, and we specify where to fill in with the cl::location attribute:

+
-bool DebugFlag;      // the actual value
+bool DebugFlag;                  // the actual value
 static cl::opt<bool, true>       // The parser
-Debug("debug", cl::desc("Enable debug output"), cl::Hidden,
-      cl::location(DebugFlag));
+Debug("debug", cl::desc("Enable debug output"), cl::Hidden, cl::location(DebugFlag));
 
+

In the above example, we specify "true" as the second argument to -the cl::opt template, indicating that the template should -not maintain a copy of the value itself. In addition to this, we specify the cl::location attribute, so that DebugFlag is -automatically set.

+the cl::opt template, indicating that the +template should not maintain a copy of the value itself. In addition to this, +we specify the cl::location attribute, so +that DebugFlag is automatically set.

@@ -1055,8 +1057,8 @@ the section on Internal vs External Storage for more information.
  • The cl::aliasopt attribute -specifies which option a cl::alias option is an alias -for.
  • +specifies which option a cl::alias option is +an alias for.
  • The cl::values attribute specifies the string-to-value mapping to be used by the generic parser. It takes a