diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-07 23:48:59 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-07 23:48:59 +0000 |
commit | 11595b20fc6b487f504dd974b28f29c65c56de86 (patch) | |
tree | 050e623481ad9c78d7db3a989f1daa44c3c610e2 /llvm/docs | |
parent | 8fc489da2a0d2976efe9de5f712d903b0b92a2d8 (diff) | |
download | bcm5719-llvm-11595b20fc6b487f504dd974b28f29c65c56de86.tar.gz bcm5719-llvm-11595b20fc6b487f504dd974b28f29c65c56de86.zip |
Add DEBUG_WITH_TYPE as a clean alternative to tweaking DEBUG_TYPE.
This:
--
#undef DEBUG_TYPE
#define DEBUG_TYPE "foo"
DEBUG(...)
#undef DEBUG_TYPE
#define DEBUG_TYPE ""
--
becomes this:
--
DEBUG_WITH_TYPE("foo", ...)
--
llvm-svn: 78435
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/ProgrammersManual.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/docs/ProgrammersManual.html b/llvm/docs/ProgrammersManual.html index e3f91a2af64..e920cbbc646 100644 --- a/llvm/docs/ProgrammersManual.html +++ b/llvm/docs/ProgrammersManual.html @@ -646,6 +646,21 @@ on when the name is specified. This allows, for example, all debug information for instruction scheduling to be enabled with <tt>-debug-type=InstrSched</tt>, even if the source lives in multiple files.</p> +<p>The <tt>DEBUG_WITH_TYPE</tt> macro is also available for situations where you +would like to set <tt>DEBUG_TYPE</tt>, but only for one specific <tt>DEBUG</tt> +statement. It takes an additional first parameter, which is the type to use. For +example, the preceeding example could be written as:</p> + + +<div class="doc_code"> +<pre> +DEBUG_WITH_TYPE("", errs() << "No debug type\n"); +DEBUG_WITH_TYPE("foo", errs() << "'foo' debug type\n"); +DEBUG_WITH_TYPE("bar", errs() << "'bar' debug type\n")); +DEBUG_WITH_TYPE("", errs() << "No debug type (2)\n"); +</pre> +</div> + </div> <!-- ======================================================================= --> |