summaryrefslogtreecommitdiff
path: root/clang-plugin/debug.h
diff options
context:
space:
mode:
authorPhilip Withnall <philip.withnall@collabora.co.uk>2014-11-17 11:37:32 +0000
committerPhilip Withnall <philip.withnall@collabora.co.uk>2014-11-17 11:37:32 +0000
commit33087d072b2179e96577575139303ba6200fbf22 (patch)
tree3d04d6c9ddb701ca82a45f77d63b79fc20ffff68 /clang-plugin/debug.h
parent0d2c91af4cd15b5939e07dc11f735b1c0009c0d0 (diff)
plugin: Add some debug macros for dumpable objects
These will be used by the GError plugin.
Diffstat (limited to 'clang-plugin/debug.h')
-rw-r--r--clang-plugin/debug.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang-plugin/debug.h b/clang-plugin/debug.h
index 562f748..978e1e7 100644
--- a/clang-plugin/debug.h
+++ b/clang-plugin/debug.h
@@ -39,10 +39,15 @@ namespace Debug {
llvm::dbgs () << M; \
(E).printPretty (llvm::dbgs (), NULL, context.getPrintingPolicy ()); \
llvm::dbgs () << "\n")
+#define DEBUG_DUMPABLE(M, D) DEBUG_WITH_TYPE ("tartan", \
+ llvm::dbgs () << M; \
+ (D).dumpToStream (llvm::dbgs ()); \
+ llvm::dbgs () << "\n")
#else
#define DEBUG(M)
#define DEBUG_EXPR(M, E)
+#define DEBUG_DUMPABLE(M, D)
#endif
/* For use with internal errors, such as unexpected precondition failures or