summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_bld_debug.h
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-08-18 20:23:35 +0100
committerJosé Fonseca <jfonseca@vmware.com>2009-08-29 09:21:34 +0100
commit5999ebfb69a47fa12d1f534871ea01a3f889f62f (patch)
treea8f3dfe882844fcb9424ba88888389dec9b85cca /src/gallium/drivers/llvmpipe/lp_bld_debug.h
parenta22f87c99462fd83dc398f4c06fc6d9997e15dba (diff)
llvmpipe: Debug helper function to name llvm intermediate values.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_debug.h')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_bld_debug.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_debug.h b/src/gallium/drivers/llvmpipe/lp_bld_debug.h
index d83652504b..ecdafef76d 100644
--- a/src/gallium/drivers/llvmpipe/lp_bld_debug.h
+++ b/src/gallium/drivers/llvmpipe/lp_bld_debug.h
@@ -30,6 +30,29 @@
#define LP_BLD_DEBUG_H
+#include <llvm-c/Core.h>
+
+#include "pipe/p_compiler.h"
+#include "util/u_string.h"
+
+
+static INLINE void
+lp_build_name(LLVMValueRef val, const char *format, ...)
+{
+#ifdef DEBUG
+ char name[32];
+ va_list ap;
+ va_start(ap, format);
+ util_vsnprintf(name, sizeof name, format, ap);
+ va_end(ap);
+ LLVMSetValueName(val, name);
+#else
+ (void)val;
+ (void)format;
+#endif
+}
+
+
void
lp_disassemble(const void* func);