summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/gallivm/lp_bld_assert.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2012-02-23 09:44:41 +0000
committerJosé Fonseca <jfonseca@vmware.com>2012-05-02 10:24:34 +0100
commit0005bd9da2b343accad423708eba36a00035c7ee (patch)
tree4f081d9646bf90724a1e845ad7051f9e4c77ecdf /src/gallium/auxiliary/gallivm/lp_bld_assert.c
parentc23fd547c060c4137eab0f878a1028c5903384eb (diff)
downloadexternal_mesa3d-0005bd9da2b343accad423708eba36a00035c7ee.zip
external_mesa3d-0005bd9da2b343accad423708eba36a00035c7ee.tar.gz
external_mesa3d-0005bd9da2b343accad423708eba36a00035c7ee.tar.bz2
gallivm: Cleanup/simplify lp_build_const_string_variable.
- Move to lp_bld_const where it belongs - Rename to lp_build_const_string - take the length from the argument (and don't count the zero terminator twice) - bitcast the constant to generic i8 *
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_assert.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_assert.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_assert.c b/src/gallium/auxiliary/gallivm/lp_bld_assert.c
index 9de5e8e..449d0a7 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_assert.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_assert.c
@@ -29,6 +29,7 @@
#include "util/u_memory.h"
#include "lp_bld_assert.h"
#include "lp_bld_init.h"
+#include "lp_bld_const.h"
#include "lp_bld_printf.h"
@@ -66,8 +67,7 @@ lp_build_assert(struct gallivm_state *gallivm,
LLVMTypeRef arg_types[2];
LLVMValueRef msg_string, assert_func, params[2], r;
- msg_string = lp_build_const_string_variable(module, context,
- msg, strlen(msg) + 1);
+ msg_string = lp_build_const_string(gallivm, msg);
arg_types[0] = LLVMInt32TypeInContext(context);
arg_types[1] = LLVMPointerType(LLVMInt8TypeInContext(context), 0);
@@ -90,7 +90,7 @@ lp_build_assert(struct gallivm_state *gallivm,
/* build function call param list */
params[0] = LLVMBuildZExt(builder, condition, arg_types[0], "");
- params[1] = LLVMBuildBitCast(builder, msg_string, arg_types[1], "");
+ params[1] = msg_string;
/* check arg types */
assert(LLVMTypeOf(params[0]) == arg_types[0]);