From: Misha Brukman To do this, set up your .h file with your option, like this for example: 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: 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. 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
// 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
+
-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));
+