diff options
author | José Fonseca <jfonseca@vmware.com> | 2012-05-16 15:00:23 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2012-05-16 15:00:23 +0100 |
commit | 9af1ba565dfd5cef9ee938bb7c04767d14878fbf (patch) | |
tree | 216f1c22bcdafa496ded08d0fe4b059173a6f791 /src/gallium/drivers/llvmpipe/lp_jit.c | |
parent | 982df3c1a5e99e43f28f849419d4379e6e5d5d05 (diff) | |
download | external_mesa3d-9af1ba565dfd5cef9ee938bb7c04767d14878fbf.zip external_mesa3d-9af1ba565dfd5cef9ee938bb7c04767d14878fbf.tar.gz external_mesa3d-9af1ba565dfd5cef9ee938bb7c04767d14878fbf.tar.bz2 |
draw,llvmpipe: Avoid named struct types on LLVM 3.0 and later.
Starting with LLVM 3.0, named structures are meant not for debugging, but
for recursive data types, previously also known as opaque types.
The recursive nature of these types leads to several memory management
difficulties. Given that we don't actually need recursive types, avoid
them altogether.
This is an attempt to address fdo bugs 41791 and 44466. The issue is
somewhat random so there's no easy way to check how effective this is.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_jit.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_jit.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index ce92a80..eb1db84 100644 --- a/src/gallium/drivers/llvmpipe/lp_jit.c +++ b/src/gallium/drivers/llvmpipe/lp_jit.c @@ -68,13 +68,9 @@ lp_jit_create_types(struct llvmpipe_context *lp) elem_types[LP_JIT_TEXTURE_BORDER_COLOR] = LLVMArrayType(LLVMFloatTypeInContext(lc), 4); -#if HAVE_LLVM >= 0x0300 - texture_type = LLVMStructCreateNamed(gallivm->context, "texture"); - LLVMStructSetBody(texture_type, elem_types, - Elements(elem_types), 0); -#else texture_type = LLVMStructTypeInContext(lc, elem_types, Elements(elem_types), 0); +#if HAVE_LLVM < 0x0300 LLVMAddTypeName(gallivm->module, "texture", texture_type); LLVMInvalidateStructLayout(gallivm->target, texture_type); @@ -134,14 +130,10 @@ lp_jit_create_types(struct llvmpipe_context *lp) elem_types[LP_JIT_CTX_TEXTURES] = LLVMArrayType(texture_type, PIPE_MAX_SAMPLERS); -#if HAVE_LLVM >= 0x0300 - context_type = LLVMStructCreateNamed(gallivm->context, "context"); - LLVMStructSetBody(context_type, elem_types, - Elements(elem_types), 0); -#else context_type = LLVMStructTypeInContext(lc, elem_types, Elements(elem_types), 0); +#if HAVE_LLVM < 0x0300 LLVMInvalidateStructLayout(gallivm->target, context_type); LLVMAddTypeName(gallivm->module, "context", context_type); |