[llvm-commits] CommandLine.html patch

Bill Wendling isanbard at gmail.com
Wed Jan 9 10:45:39 PST 2008


On Jan 9, 2008 9:34 AM, Sam Bishop <sam at bishop.dhs.org> wrote:
> Also, I was confused by one of the examples regarding the handling of
> program-wide global options such as a debug flag.  "DebugFlag" is the global
> variable set by the parser; the following is given as an example of how you
> would use it:
>
> // DEBUG macro - This macro should be used by code to emit debug information.
> // In the '-debug' option is specified on the command line, and if this is a
> // debug build, then the code specified as the option to the macro will be
> // executed.  Otherwise it will not be.  Example:
> //
> // DOUT << "Bitset contains: " << Bitset << "\n";
> //
> #ifdef NDEBUG
> #define DEBUG(X)
> #else
> #define DEBUG(X) do { if (DebugFlag) { X; } } while (0)
> #endif
>
> I'm very new to LLVM, so I can only guess at how DOUT is related to DEBUG().
>  Is there another example that would be more straightforward?
>
DOUT is documented here:

  http://llvm.org/docs/CodingStandards.html#ll_iostream

Though you're right that this example is misplaced.

-bw



More information about the llvm-commits mailing list