From 9af1ba565dfd5cef9ee938bb7c04767d14878fbf Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 16 May 2012 15:00:23 +0100 Subject: 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. --- src/gallium/drivers/llvmpipe/lp_jit.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/gallium/drivers/llvmpipe') diff --git a/src/gallium/drivers/llvmpipe/lp_jit.c b/src/gallium/drivers/llvmpipe/lp_jit.c index ce92a80721a..eb1db84e4b8 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); -- cgit v1.2.3