numba / llvmlite

A lightweight LLVM python binding for writing JIT compilers
https://llvmlite.pydata.org/
BSD 2-Clause "Simplified" License
1.92k stars 316 forks source link

Allow codemodel and relocmodel to be optional when creating target machine #406

Open sklam opened 6 years ago

sklam commented 6 years ago

Change https://github.com/numba/llvmlite/blob/ebc4c596ae74d5667790948c56fea41fa1d11885/ffi/targets.cpp#L167-L231 to accept optional codemodel and relocmodel. The createTagetMachine now takes them as Optional in http://llvm.org/doxygen/classllvm_1_1Target.html#a3a99d5ba8f023d04d34f652af7494b35. This will simplify the targetmachine creation process as codemodel and relocmodel is set differently of different platform.
Thus, avoiding the need of code like: https://github.com/numba/numba/pull/3437/files#diff-ec37b531d0f5e6e4ff2bb91a63bd651dR800

sklam commented 5 years ago

Related issue: https://github.com/numba/llvmlite/issues/457#issuecomment-491384787