From 5999ebfb69a47fa12d1f534871ea01a3f889f62f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 18 Aug 2009 20:23:35 +0100 Subject: llvmpipe: Debug helper function to name llvm intermediate values. --- src/gallium/drivers/llvmpipe/lp_bld_debug.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/gallium/drivers/llvmpipe/lp_bld_debug.h') 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 + +#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); -- cgit v1.2.3