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 | 8350419ba05bac1934c64c1537d3c9b935c64022 (patch) | |
tree | 9aa7c034cf40476365e7a8028beff6c7bd7c2317 /docs/ProgrammersManual.html | |
parent | a6831ed3c9fd638e0fa63b618f9b6af630bd45fd (diff) | |
download | external_llvm-8350419ba05bac1934c64c1537d3c9b935c64022.zip external_llvm-8350419ba05bac1934c64c1537d3c9b935c64022.tar.gz external_llvm-8350419ba05bac1934c64c1537d3c9b935c64022.tar.bz2 |
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", ...)
--
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78435 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/ProgrammersManual.html')
-rw-r--r-- | docs/ProgrammersManual.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index e3f91a2..e920cbb 100644 --- a/docs/ProgrammersManual.html +++ b/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> <!-- ======================================================================= --> |