Path: blob/21.2-virgl/src/gallium/auxiliary/gallivm/lp_bld_debug.h
4565 views
/**************************************************************************1*2* Copyright 2009 VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/262728#ifndef LP_BLD_DEBUG_H29#define LP_BLD_DEBUG_H303132#include "gallivm/lp_bld.h"3334#include "pipe/p_compiler.h"35#include "util/u_string.h"363738#define GALLIVM_DEBUG_TGSI (1 << 0)39#define GALLIVM_DEBUG_IR (1 << 1)40#define GALLIVM_DEBUG_ASM (1 << 2)41#define GALLIVM_DEBUG_PERF (1 << 3)42#define GALLIVM_DEBUG_GC (1 << 4)43#define GALLIVM_DEBUG_DUMP_BC (1 << 5)4445#define GALLIVM_PERF_NO_BRILINEAR (1 << 0)46#define GALLIVM_PERF_NO_RHO_APPROX (1 << 1)47#define GALLIVM_PERF_NO_QUAD_LOD (1 << 2)48#define GALLIVM_PERF_NO_OPT (1 << 3)49#define GALLIVM_PERF_NO_AOS_SAMPLING (1 << 4)5051#ifdef __cplusplus52extern "C" {53#endif545556extern unsigned gallivm_perf;5758#ifdef DEBUG59extern unsigned gallivm_debug;60#else61#define gallivm_debug 062#endif636465static inline void66lp_build_name(LLVMValueRef val, const char *format, ...)67{68#ifdef DEBUG69char name[32];70va_list ap;71va_start(ap, format);72vsnprintf(name, sizeof name, format, ap);73va_end(ap);74LLVMSetValueName(val, name);75#else76(void)val;77(void)format;78#endif79}808182void83lp_debug_dump_value(LLVMValueRef value);848586boolean87lp_check_alignment(const void *ptr, unsigned alignment);888990void91lp_disassemble(LLVMValueRef func, const void *code);929394void95lp_profile(LLVMValueRef func, const void *code);969798#ifdef __cplusplus99}100#endif101102103#endif /* !LP_BLD_DEBUG_H */104105106