diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-08-18 20:23:35 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-08-29 09:21:34 +0100 |
commit | 5999ebfb69a47fa12d1f534871ea01a3f889f62f (patch) | |
tree | a8f3dfe882844fcb9424ba88888389dec9b85cca /src/gallium/drivers/llvmpipe/lp_bld_debug.h | |
parent | a22f87c99462fd83dc398f4c06fc6d9997e15dba (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.h | 23 |
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); |