gallivm: work around LLVM 2.6 bug when calling C functions
authorBrian Paul <brianp@vmware.com>
Thu, 16 Dec 2010 17:13:02 +0000 (10:13 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 16 Dec 2010 17:19:16 +0000 (10:19 -0700)
commitee16e97ed1d0921c533c77688b278bef393d9922
tree3ddbc79232669412d4538249b2040bebe7929800
parentb7e150605d402224cdd8fa3d186924bdee3c6c49
gallivm: work around LLVM 2.6 bug when calling C functions

Create a constant int pointer to the C function, then cast it to the
function's type.  This avoids using trampoline code which seem to be
inadvertantly freed by LLVM in some situations (which leads to segfaults).
The root issue and work-around were found by José.

NOTE: This is a candidate for the 7.10 branch
src/gallium/auxiliary/gallivm/lp_bld_const.h
src/gallium/auxiliary/gallivm/lp_bld_format_aos.c