[haskell-llvm] support for multiple LLVM versions in llvm-base

Henning Thielemann lemming at henning-thielemann.de
Sat May 18 13:39:01 BST 2013


Currently there are a lot of CPP switches that conditionally import 
functions from LLVM. However that means that the same version of llvm-base 
has a different API depending on the LLVM version it was compiled with. 
This does not work. Every version of a Cabal package must have a defined 
API, independend from Cabal flags and other configurations:
   http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Enabling_additional_features_via_Cabal_flags

The correct way to go is to let llvm-base-3.0 export the interface of 
LLVM-3.0, llvm-base-3.1 export the interface of LLVM-3.1 and so on. It 
would be ok to implement the interface of llvm-base-3.0 with LLVM-3.1, 
though, if this works.

This also stresses my point, that the ST (and Wrapper) code should be in a 
separate package since I think that their interfaces are independent from 
the LLVM API. The new package could still accept a range of versions of 
llvm-base.



More information about the Haskell-llvm mailing list