diff options
author | José Fonseca <[email protected]> | 2010-05-15 11:42:02 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2010-05-15 11:42:02 +0100 |
commit | 145fd48b378c1b4767e9aa72f1b01e69a2281a62 (patch) | |
tree | 12ef2b77ecbd278aafe8fe608d4849a36bd05b49 /src/gallium/auxiliary/gallivm/lp_bld_init.c | |
parent | 263e038431f24f24aaec252e135ffc9f2f09640e (diff) |
gallivm: Centralize some of the LLVM debugging options.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_init.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_init.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index 5067d0a164f..bd080f397aa 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -29,9 +29,23 @@ #include "pipe/p_compiler.h" #include "util/u_cpu_detect.h" #include "util/u_debug.h" +#include "lp_bld_debug.h" #include "lp_bld_init.h" +#ifdef DEBUG +unsigned gallivm_debug = 0; + +static const struct debug_named_value lp_bld_debug_flags[] = { + { "tgsi", GALLIVM_DEBUG_TGSI }, + { "ir", GALLIVM_DEBUG_IR }, + { "asm", GALLIVM_DEBUG_ASM }, + { "nopt", GALLIVM_DEBUG_NO_OPT }, + {NULL, 0} +}; +#endif + + LLVMModuleRef lp_build_module = NULL; LLVMExecutionEngineRef lp_build_engine = NULL; LLVMModuleProviderRef lp_build_provider = NULL; @@ -41,6 +55,10 @@ LLVMTargetDataRef lp_build_target = NULL; void lp_build_init(void) { +#ifdef DEBUG + gallivm_debug = debug_get_flags_option("GALLIVM_DEBUG", lp_bld_debug_flags, 0 ); +#endif + LLVMInitializeNativeTarget(); LLVMLinkInJIT(); |