X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fauxiliary%2Fgallivm%2Flp_bld_printf.c;h=69d829ea6762a45956605f39742a8831c4dfced6;hb=52381a7ffba908410f7a53855f082401fca7293a;hp=7a6bbd960bee1331aa0e6c05455ecb0bab8a4179;hpb=33ffca713a5e593beda34d6bcbee8fb1af472cf7;p=mesa.git diff --git a/src/gallium/auxiliary/gallivm/lp_bld_printf.c b/src/gallium/auxiliary/gallivm/lp_bld_printf.c index 7a6bbd960be..69d829ea676 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_printf.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_printf.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "util/u_debug.h" #include "util/u_memory.h" @@ -106,11 +107,17 @@ lp_build_print_value(struct gallivm_state *gallivm, type_fmt[4] = 'g'; type_fmt[5] = '\0'; } else if (type_kind == LLVMIntegerTypeKind) { - if (LLVMGetIntTypeWidth(type_ref) == 8) { + if (LLVMGetIntTypeWidth(type_ref) == 64) { + unsigned flen = strlen(PRId64); + assert(flen <= 3); + strncpy(type_fmt + 2, PRId64, flen); + } else if (LLVMGetIntTypeWidth(type_ref) == 8) { type_fmt[2] = 'u'; } else { type_fmt[2] = 'i'; } + } else if (type_kind == LLVMPointerTypeKind) { + type_fmt[2] = 'p'; } else { /* Unsupported type */ assert(0);