diff options
author | Brian Paul <brianp@vmware.com> | 2010-11-30 16:07:52 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-11-30 16:35:12 -0700 |
commit | efc82aef35a2aac5d2ed9774f6d28f2626796416 (patch) | |
tree | 72fe4482d72dbeb8e41b15793b21f38de62ef834 /src/gallium/auxiliary/gallivm/lp_bld_intr.c | |
parent | 1f1375d4d876c2c85156e02a177254684446040b (diff) |
gallivm/llvmpipe: squash merge of the llvm-context branch
This branch defines a gallivm_state structure which contains the
LLVMBuilderRef, LLVMContextRef, etc. All data structures built with
this object can be periodically freed during a "garbage collection"
operation.
The gallivm_state object has to be passed to most of the builder
functions where LLVMBuilderRef used to be used.
Conflicts:
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c
src/gallium/drivers/llvmpipe/lp_state_setup.c
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_intr.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_intr.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_intr.c b/src/gallium/auxiliary/gallivm/lp_bld_intr.c index 9895749d56..518a01fdb9 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_intr.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_intr.c @@ -46,6 +46,7 @@ #include "util/u_debug.h" +#include "lp_bld_const.h" #include "lp_bld_intr.h" @@ -136,12 +137,13 @@ lp_build_intrinsic_binary(LLVMBuilderRef builder, LLVMValueRef -lp_build_intrinsic_map(LLVMBuilderRef builder, +lp_build_intrinsic_map(struct gallivm_state *gallivm, const char *name, LLVMTypeRef ret_type, LLVMValueRef *args, unsigned num_args) { + LLVMBuilderRef builder = gallivm->builder; LLVMTypeRef ret_elem_type = LLVMGetElementType(ret_type); unsigned n = LLVMGetVectorSize(ret_type); unsigned i, j; @@ -151,7 +153,7 @@ lp_build_intrinsic_map(LLVMBuilderRef builder, res = LLVMGetUndef(ret_type); for(i = 0; i < n; ++i) { - LLVMValueRef index = LLVMConstInt(LLVMInt32Type(), i, 0); + LLVMValueRef index = lp_build_const_int32(gallivm, i); LLVMValueRef arg_elems[LP_MAX_FUNC_ARGS]; LLVMValueRef res_elem; for(j = 0; j < num_args; ++j) @@ -165,17 +167,17 @@ lp_build_intrinsic_map(LLVMBuilderRef builder, LLVMValueRef -lp_build_intrinsic_map_unary(LLVMBuilderRef builder, +lp_build_intrinsic_map_unary(struct gallivm_state *gallivm, const char *name, LLVMTypeRef ret_type, LLVMValueRef a) { - return lp_build_intrinsic_map(builder, name, ret_type, &a, 1); + return lp_build_intrinsic_map(gallivm, name, ret_type, &a, 1); } LLVMValueRef -lp_build_intrinsic_map_binary(LLVMBuilderRef builder, +lp_build_intrinsic_map_binary(struct gallivm_state *gallivm, const char *name, LLVMTypeRef ret_type, LLVMValueRef a, @@ -186,7 +188,7 @@ lp_build_intrinsic_map_binary(LLVMBuilderRef builder, args[0] = a; args[1] = b; - return lp_build_intrinsic_map(builder, name, ret_type, args, 2); + return lp_build_intrinsic_map(gallivm, name, ret_type, args, 2); } |