[LLVMdev] How shall we modify llvm's OCaml binding to support LLVMContext?

Erick Tryzelaar idadesub at users.sourceforge.net
Thu Aug 13 17:53:44 PDT 2009


I've partially ported the OCaml bindings to support LLVMContext, and I
wanted to get people's opinion on how to implement it in the API. For the
LLVM's C++ api, many key functions were modified to only take a LLVMContext,
such as replacing the global variable Type::FloatTy with a function
Type::getFloatTy(LLVMContext&). For llvm-c though, we need to maintain
backwards compatibility so we've modified LLVMFloatType() to internally use
getGlobalContext(), and added LLVMFloatTypeInContext(LLVMContextRef) in
order to explicitly choose which context to use. So, the question is what do
we do with OCaml? Do we feel that we can break backwards compatibility and
force passing around the LLVMContext, or should I follow llvm-c's lead, and
add a bunch of *_in_context functions so that the API doesn't change?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090813/58cf1870/attachment.html>


More information about the llvm-dev mailing list