From c3c9239d76e2acb01dac8c72323a0b28fadebe4b Mon Sep 17 00:00:00 2001
From: Daniel Dunbar
Date: Fri, 7 Aug 2009 23:48:59 +0000
Subject: 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
---
docs/ProgrammersManual.html | 15 +++++++++++++++
1 file changed, 15 insertions(+)
(limited to 'docs')
diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html
index e3f91a2af6..e920cbbc64 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 -debug-type=InstrSched,
even if the source lives in multiple files.
+The DEBUG_WITH_TYPE macro is also available for situations where you
+would like to set DEBUG_TYPE, but only for one specific DEBUG
+statement. It takes an additional first parameter, which is the type to use. For
+example, the preceeding example could be written as:
+
+
+
+
+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");
+
+
+
--
cgit v1.2.3