summaryrefslogtreecommitdiffstats
path: root/llvm/bindings/ocaml
Commit message (Collapse)AuthorAgeFilesLines
...
* [OCaml] Bump ctypes dependency to 0.4.Peter Zotov2015-06-271-5/+5
| | | | | | | | | | | | ctypes 0.3 and earlier contains an interface-definig bug: its ptr_of_raw_address accepts Int64 and not Nativeint. ctypes 0.4 was not released during the 3.6 cycle, and because of that, LLVM 3.6 was released with ctypes 0.3 as a dependency, which now breaks the build on modern ctypes. Unbreak. llvm-svn: 240882
* Update LLVM bindings after r239940. Apparently these aren't included inDaniel Jasper2015-06-181-1/+1
| | | | | | | | | any tests and I even don't know how to run the tests. This seems like a minimal change to make them work again, although I can't really verify at this point. Additionally, it probably makes sense to propagate the personality parameter removal further. llvm-svn: 240010
* [OCaml] Add Llvm.build_empty_phi.Peter Zotov2015-02-063-0/+17
| | | | llvm-svn: 228395
* [OCaml] Allow out-of-tree builds of LLVM bindings.Peter Zotov2015-01-131-2/+9
| | | | | | | | | | | | In order to use this feature, configure LLVM as usual, but then build and install it as: make all install SYSTEM_LLVM_CONFIG=llvm-config where llvm-config is the llvm-config binary installed on your system (possibly llvm-config-VERSION on e.g. Debian). llvm-svn: 225787
* [OCaml] Use $CAMLORIGIN, an rpath-$ORIGIN-like mechanism in OCaml.Peter Zotov2015-01-131-4/+10
| | | | | | | | | | | | | | | As a result, installations of LLVM in non-standard locations will not require passing custom -ccopt -L flags when building the binary, nor absolute paths would be embedded in the cma/cmxa files. Additionally, the executables will not require changes to LD_LIBRARY_PATH, although CAML_LD_LIBRARY_PATH still has to be set for ocamlc without -custom. See http://caml.inria.fr/mantis/view.php?id=6642. Note that the patch is approved, but not merged yet. It will be released in 4.03 and likely 4.02. llvm-svn: 225778
* [OCaml] [cmake] Use LLVM_LIBRARY_DIR instead of LLVM_LIBRARY_OUTPUT_INTDIR.Peter Zotov2014-12-302-4/+4
| | | | | | | | The latter variable is internal. Original patch by Ramkumar Ramachandra <artagnon@gmail.com> llvm-svn: 224977
* [OCaml] Expose Llvm_executionengine.get_{global_value,function}_address.Peter Zotov2014-12-243-15/+40
| | | | | | | | | Patch by Ramkumar Ramachandra <artagnon@gmail.com>. Also remove Llvm_executionengine.get_pointer_to_global, as it is actually deprecated and didn't appear in a stable release. llvm-svn: 224801
* Finish removing DestroySource.Rafael Espindola2014-12-233-18/+5
| | | | | | Fixes pr21901. llvm-svn: 224782
* [OCaml] PR22014: OCaml bindings didn't link to libLLVM-*.so with -Wl,--as-neededPeter Zotov2014-12-231-2/+2
| | | | | | Patch by Evangelos Foutras <evangelos@foutrelis.com>. llvm-svn: 224766
* [OCaml] Add Llvm.mdnull.Peter Zotov2014-12-023-0/+9
| | | | | | Patch by Gideon Smeding <gideon.smeding@3ds.com>. llvm-svn: 223129
* [OCaml] Move Llvm.clone_module to its own Llvm_transform_utils module.Peter Zotov2014-12-0112-7/+94
| | | | | | | This way most code won't link this (substantially large) library, if compiled statically with LLVM. llvm-svn: 223072
* [OCaml] [cmake] Add CMake buildsystem for OCaml.Peter Zotov2014-12-0116-0/+114
| | | | | | Closes PR15325. llvm-svn: 223071
* [OCaml] Fix mismatched CAMLparam/CAMLreturn.Peter Zotov2014-11-031-4/+3
| | | | | | | Also, revert r221142--it was an incorrect fix to this bug which fixed tests by accident. llvm-svn: 221149
* [OCaml] Add -g on DEBUG_SYMBOLS=1, not ENABLE_OPTIMIZED.Peter Zotov2014-11-031-1/+1
| | | | | | Thanks echristo for pointing this out. llvm-svn: 221145
* [OCaml] Don't use deprecated non-caml_namespaced functions.Peter Zotov2014-11-031-7/+7
| | | | llvm-svn: 221143
* [OCaml] Initialize local roots prior to raising.Peter Zotov2014-11-031-3/+4
| | | | | | On 4.02, the OCaml unwinder otherwise gets confused and segfaults. llvm-svn: 221142
* [OCaml] Core package should depend on LLVMTransformUtils for LLVMCloneModule.Peter Zotov2014-11-031-1/+1
| | | | llvm-svn: 221141
* [OCaml] Fix ocamlc -custom builds when configured as --enable-shared.Peter Zotov2014-11-031-2/+3
| | | | llvm-svn: 221140
* [OCaml] Avoid embedding absolute paths into executables.Peter Zotov2014-11-031-14/+14
| | | | | | | | | | | | Bindings built out-of-tree, e.g. via OPAM, should append a line to META.llvm like the following: linkopts = "-cclib -L$libdir -cclib -Wl,-rpath,$libdir" where $libdir is the lib/ directory where LLVM libraries are installed. llvm-svn: 221139
* [OCaml] Don't build stub libraries twice.Peter Zotov2014-11-031-0/+3
| | | | | | | The default Makefile.rules BUILD_ARCHIVE machinery was unintentionally enabled. llvm-svn: 221138
* [OCaml] META: remove exists_if(toplevel).Peter Zotov2014-11-032-2/+0
| | | | | | | ocamlfind ignores the predicates in this case, making the package unavailable for batch compilation as well. llvm-svn: 221136
* [OCaml] ExecutionEngine package should not depend on interpreter.Peter Zotov2014-11-031-1/+1
| | | | | | Interpreter support was removed in r220957. llvm-svn: 221135
* [OCaml] Ensure consistent naming.Peter Zotov2014-10-316-3/+3
| | | | | | | | | Specifically: * Directories match module names. * Test names match module names. * The language is called "OCaml", not "Ocaml". llvm-svn: 220958
* [OCaml] Rework Llvm_executionengine using ctypes.Peter Zotov2014-10-316-527/+145
| | | | | | | | | | | | | | | | | | | | | | | | Since JIT->MCJIT migration, most of the ExecutionEngine interface became deprecated and/or broken. This especially affected the OCaml bindings, as runFunction is no longer available, and unlike in C, it is not possible to coerce a pointer to a function and call it in OCaml. In practice, LLVM 3.5 shipped completely unusable Llvm_executionengine. The GenericValue interface and runFunction were essentially a poor man's FFI. As such, this interface was removed and instead a dependency on ctypes >=0.3 added, which handled platform-specific aspects of accessing data and calling functions. The new interface does not expose JIT (which is a shim around MCJIT), as well as the interpreter (which can't handle a lot of valid IR). Llvm_executionengine.add_global_mapping is currently unusable due to PR20656. llvm-svn: 220957
* [OCaml] Expose LLVMCloneModule.Peter Zotov2014-10-302-0/+4
| | | | llvm-svn: 220903
* [OCaml] Expose LLVM{Get,Set}DLLStorageClass.Peter Zotov2014-10-303-0/+37
| | | | llvm-svn: 220902
* [OCaml] [autoconf] Migrate to ocamlfind.Peter Zotov2014-10-301-46/+18
| | | | | | | | | | | | | | | | | | | | | | This commit updates the OCaml bindings and tests to use ocamlfind. The bindings are migrated in order to use ctypes, which are now required for MCJIT-backed Llvm_executionengine. The tests are migrated in order to use OUnit and to verify that the distributed META.llvm allows to build working executables. Every OCaml toolchain invocation is now chained through ocamlfind, which (in theory) allows to cross-compile the OCaml bindings. The configure script now checks for ctypes (>= 0.2.3) and OUnit (>= 2). The code depending on these libraries will be added later. The configure script does not check the package versions in order to keep changes less invasive. Additionally, OCaml bindings will now be automatically enabled if ocamlfind is detected on the system, rather than ocamlc, as it was before. llvm-svn: 220899
* [OCaml] De-duplicate llvm_raise and llvm_string_of_message.Peter Zotov2014-10-307-71/+14
| | | | llvm-svn: 220898
* [OCaml] Expose Llvm.parse_command_line_options.Peter Zotov2014-10-293-0/+21
| | | | llvm-svn: 220847
* [OCaml] Expose Llvm_target.TargetMachine.add_analysis_passes.Peter Zotov2014-10-293-0/+13
| | | | llvm-svn: 220846
* [OCaml] If compiled without --enable-shared, hide packages from toplevel.Peter Zotov2014-10-292-0/+2
| | | | | | | | | | | Pretend they do not exist using exists_if. This is better than the current situation, which is the error: Error: The external function `llvm_global_succ' is not available but still somewhat confusing. llvm-svn: 220845
* [OCaml] Expose Llvm_bitwriter.write_bitcode_to_memory_buffer.Peter Zotov2014-10-293-13/+28
| | | | llvm-svn: 220844
* [OCaml] Drop support for 3.12.1 and earlier.Peter Zotov2014-10-2928-262/+166
| | | | | | | | | | In practice this means: * Always using -g flag. * Embedding -cclib -lstdc++ into the corresponding cma/cmxa file. This also moves -lstdc++ in a single place. * Using caml_named_value instead of a homegrown mechanism. llvm-svn: 220843
* [OCaml] Synchronize transformations with LLVM-C.Peter Zotov2014-10-299-385/+479
| | | | | | | Also, rearrange the functions in a way that allows to quickly compare C headers and .mli/glue files. llvm-svn: 220842
* [OCaml] PR19859: Add functions to query and modify branches.Peter Zotov2014-10-283-0/+140
| | | | | | Patch by Gabriel Radanne <drupyog@zoho.com>. llvm-svn: 220818
* [OCaml] PR19859: Add Llvm.{fcmp_predicate,float_of_const}.Peter Zotov2014-10-283-0/+40
| | | | | | Patch by Gabriel Radanne <drupyog@zoho.com>. llvm-svn: 220815
* [OCaml] Enable -g for debug builds.Peter Zotov2014-10-281-4/+3
| | | | | | We don't care about pre-3.12.1 anymore. llvm-svn: 220767
* [OCaml] Fix whitespace.Peter Zotov2014-10-2813-65/+65
| | | | llvm-svn: 220766
* [OCaml] Expose existing documentation in ocamldoc.Peter Zotov2014-10-261-43/+43
| | | | | | Patch by Gabriel Radanne <drupyog@zoho.com>. llvm-svn: 220648
* [OCaml] Unbreak Llvm_executionengine.initialize_native_target.Peter Zotov2014-10-251-14/+16
| | | | | | | | | | | | | First, return true on success, as it is the OCaml convention. Second, also initialize the native assembly printer, which is, despite the name, required for MCJIT operation. Since this function did not initialize the assembly printer earlier and no function to initialize native assembly printer was available elsewhere, it is safe to break its interface: it means that it simply could not be used successfully before. llvm-svn: 220620
* [OCaml] Expose Llvm_executionengine.ExecutionEngine.create_mcjit.Peter Zotov2014-10-253-27/+103
| | | | llvm-svn: 220619
* [OCaml] Fix a typo in documentation.Peter Zotov2014-10-221-1/+1
| | | | llvm-svn: 220377
* [OCaml] Add Llvm.instr_clone.Peter Zotov2014-10-173-0/+13
| | | | llvm-svn: 220008
* Reinstate "Nuke the old JIT."Eric Christopher2014-09-022-2/+2
| | | | | | | | Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reinstates commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 216982
* [OCaml] Expose Llvm.get_operand_use.Peter Zotov2014-08-123-0/+11
| | | | | | Patch by Gabriel Radanne <drupyog@zoho.com> llvm-svn: 215420
* Temporarily Revert "Nuke the old JIT." as it's not quite ready toEric Christopher2014-08-072-2/+2
| | | | | | | | | | | be deleted. This will be reapplied as soon as possible and before the 3.6 branch date at any rate. Approved by Jim Grosbach, Lang Hames, Rafael Espindola. This reverts commits r215111, 215115, 215116, 215117, 215136. llvm-svn: 215154
* Fix the ocaml bindings.Rafael Espindola2014-08-072-2/+2
| | | | llvm-svn: 215117
* [OCaml] Add Llvm.{string_of_const,const_element}.Peter Zotov2014-08-033-1/+35
| | | | llvm-svn: 214677
* [OCaml] Don't truncate constants over 32 bits in Llvm.const_int.Peter Zotov2014-07-221-1/+1
| | | | llvm-svn: 213655
* MergedLoadStoreMotion passGerolf Hoflehner2014-07-181-0/+6
| | | | | | | | | | | Merges equivalent loads on both sides of a hammock/diamond and hoists into into the header. Merges equivalent stores on both sides of a hammock/diamond and sinks it to the footer. Can enable if conversion and tolerate better load misses and store operand latencies. llvm-svn: 213396
OpenPOWER on IntegriCloud