Mesa (mesa_7_7_branch): llvmpipe: Use assert instead of abort. Only verify functions on debug builds.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Thu Jan 28 12:23:04 PST 2010


Module: Mesa
Branch: mesa_7_7_branch
Commit: 12ba3559785fa276b3b4b6fa06cfe551b87aecc3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=12ba3559785fa276b3b4b6fa06cfe551b87aecc3

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Nov 23 11:21:11 2009 +0000

llvmpipe: Use assert instead of abort. Only verify functions on debug builds.

---

 src/gallium/drivers/llvmpipe/lp_jit.c      |    2 +-
 src/gallium/drivers/llvmpipe/lp_state_fs.c |    4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c
index b5aa7d6..7e019d4 100644
--- a/src/gallium/drivers/llvmpipe/lp_jit.c
+++ b/src/gallium/drivers/llvmpipe/lp_jit.c
@@ -166,7 +166,7 @@ lp_jit_screen_init(struct llvmpipe_screen *screen)
    if (LLVMCreateJITCompiler(&screen->engine, screen->provider, 1, &error)) {
       _debug_printf("%s\n", error);
       LLVMDisposeMessage(error);
-      abort();
+      assert(0);
    }
 
    screen->target = LLVMGetExecutionEngineTargetData(screen->engine);
diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 48ec5e1..2b6965d 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -620,10 +620,12 @@ generate_fragment(struct llvmpipe_context *lp,
     * Translate the LLVM IR into machine code.
     */
 
+#ifdef DEBUG
    if(LLVMVerifyFunction(variant->function, LLVMPrintMessageAction)) {
       LLVMDumpValue(variant->function);
-      abort();
+      assert(0);
    }
+#endif
 
    LLVMRunFunctionPassManager(screen->pass, variant->function);
 



More information about the mesa-commit mailing list