Gordon Henriksen
773ba13395
This patch cleans up the OCaml bindings so that they format nicely with
...
ocamldoc. It does not yet hook into the build system, though.
Patch by Erick Tryzelaar!
llvm-svn: 48095
2008-03-09 07:17:38 +00:00
Gordon Henriksen
5da39fa644
Cleanup some comments in the OCaml bindings.
...
Patch by Erick Tryzelaar.
llvm-svn: 48014
2008-03-07 19:13:06 +00:00
Gordon Henriksen
20c6e292a5
Fix a typo. 'make clean' in bindings/ocaml would leave an output.
...
llvm-svn: 48012
2008-03-07 18:43:51 +00:00
Gordon Henriksen
1850fc4fa2
Fix a typo noticed by Erick Tryzelaar,
...
llvm-svn: 47886
2008-03-04 14:52:05 +00:00
Gordon Henriksen
87171d82dc
Modify Makefile.rules to allow makefiles to prepend to C.Flags and
...
fiends. Change Makefile.ocaml to not touch CFLAGS.
llvm-svn: 45663
2008-01-06 21:54:35 +00:00
Gordon Henriksen
bc89f424b7
Fix a typo in llvm.mli noticed by Alain Frisch.
...
llvm-svn: 45585
2008-01-04 13:21:02 +00:00
Gordon Henriksen
35d9fcb448
Quote a path in the Ocaml makefile which is likely to include spaces on Windows.
...
llvm-svn: 45580
2008-01-04 11:55:57 +00:00
Gordon Henriksen
2d87c21eff
Trying r45451 again, but this time warning-free on 3.10.x.
...
llvm-svn: 45452
2007-12-30 18:12:41 +00:00
Gordon Henriksen
28347a471e
Remove some lines that are nonportable to Ocaml 3.06.
...
llvm-svn: 45451
2007-12-30 17:48:11 +00:00
Chris Lattner
7a9b0bf0eb
remove attribution from a variety of miscellaneous files.
...
llvm-svn: 45425
2007-12-29 22:59:10 +00:00
Gordon Henriksen
36da9ea958
Bindings for instruction calling conventions.
...
llvm-svn: 45422
2007-12-29 20:45:00 +00:00
Chris Lattner
6aece93d5c
remove attributions from the rest of the llvm makefiles.
...
llvm-svn: 45416
2007-12-29 20:11:13 +00:00
Gordon Henriksen
86e98275ff
Adding bindings for target triple and data layout.
...
llvm-svn: 45369
2007-12-27 20:13:47 +00:00
Gordon Henriksen
997a800e99
Adding an uninitialized builder constructor to the Ocaml bindings.
...
llvm-svn: 45362
2007-12-26 21:21:51 +00:00
Gordon Henriksen
653a9e4c7f
Disabling -g for ocaml builds; it's not downwards compatible.
...
llvm-svn: 45352
2007-12-25 08:37:43 +00:00
Gordon Henriksen
2d254558ca
Fix some Ocaml GC errors noticed upon review.
...
llvm-svn: 45336
2007-12-23 17:10:23 +00:00
Gordon Henriksen
606ac32019
C and Ocaml bindings for ExecutionEngine (i.e., the JIT compiler).
...
llvm-svn: 45335
2007-12-23 16:59:28 +00:00
Gordon Henriksen
4c9ef1e54f
Use a module to group calling convention values, too.
...
llvm-svn: 45236
2007-12-20 00:13:26 +00:00
Gordon Henriksen
fe94b95046
Using modules to group enumerations in Ocaml bindings.
...
llvm-svn: 45229
2007-12-19 22:54:12 +00:00
Gordon Henriksen
46137f1e2e
Adding bindings for memory buffers and module providers. Switching
...
to exceptions rather than variants for error handling in Ocaml.
llvm-svn: 45226
2007-12-19 22:30:40 +00:00
Gordon Henriksen
ef2c27d164
C and Ocaml bindings for address spaces, for that burgeoning market
...
for Ocaml-based compilers targeting embedded devices. :)
llvm-svn: 45096
2007-12-17 16:08:32 +00:00
Gordon Henriksen
3f070cf3b9
Add (very basic) bindings for ModuleProvider.
...
llvm-svn: 44899
2007-12-12 01:04:30 +00:00
Gordon Henriksen
aff6e2bba2
Adding Ocaml bindings for the bitreader as requested by Sarah
...
Thompson. Usage should be something like this:
open Llvm
open Llvm_bitreader
match read_bitcode_file fn with
| Bitreader_failure msg ->
prerr_endline msg
| Bitreader_success m ->
...;
dispose_module m
Compile with: ocamlc llvm.cma llvm_bitreader.cma
ocamlopt llvm.cmxa llvm_bitreader.cmxa
llvm-svn: 44824
2007-12-11 00:20:48 +00:00
Gordon Henriksen
5d201e0bcc
Adding a collector name attribute to Function in the IR. These
...
methods are new to Function:
bool hasCollector() const;
const std::string &getCollector() const;
void setCollector(const std::string &);
void clearCollector();
The assembly representation is as such:
define void @f() gc "shadow-stack" { ...
The implementation uses an on-the-side table to map Functions to
collector names, such that there is no overhead. A StringPool is
further used to unique collector names, which are extremely
likely to be unique per process.
llvm-svn: 44769
2007-12-10 03:18:06 +00:00
Gordon Henriksen
0e02790ad5
Fix bug in constructing Ocaml option types in the bindings.
...
llvm-svn: 44704
2007-12-08 16:55:43 +00:00
Gordon Henriksen
90d6c0aea2
Track dependencies when creating symlinks to LLVM libraries next
...
to the ocaml bindings. This is required on Windows where 'ln -sf'
actually creates a copy. Thanks to Alain Frisch for noticing this.
llvm-svn: 44547
2007-12-03 21:15:53 +00:00
Gordon Henriksen
a01c1e3dd5
Adding ocamldoc-style comments for the Ocaml bindings.
...
llvm-svn: 44494
2007-12-01 21:01:15 +00:00
Gordon Henriksen
acf0aac0c1
Fix ocaml bindings for picky linkers. :)
...
Thanks to Török Edvin for helping to track this down.
llvm-svn: 42927
2007-10-12 19:48:13 +00:00
Gordon Henriksen
84b068154b
C and Objective Caml bindings for PHINode::addIncoming etc.
...
llvm-svn: 42760
2007-10-08 18:14:39 +00:00
Gordon Henriksen
739a5252cb
Fixed downrev Ocaml compatibility.
...
llvm-svn: 42744
2007-10-08 12:16:59 +00:00
Gordon Henriksen
8d8fae73c5
C and Objective Caml bindings for getFunction and getNamedGlobal. Also enhanced
...
the Objective Caml 'declare_*' functions to behave more or less like
getOrInsertFunction.
llvm-svn: 42740
2007-10-08 03:45:09 +00:00
Gordon Henriksen
454d171c26
C and Objective Caml bindings for GlobalVariable::isConstant.
...
llvm-svn: 42736
2007-10-07 17:31:42 +00:00
Gordon Henriksen
99c0e2918b
C and Objective Caml bindings for PATypeHolder.
...
llvm-svn: 42713
2007-10-07 00:13:35 +00:00
Gordon Henriksen
06eeba26c1
Bindings for the verifier.
...
llvm-svn: 42707
2007-10-06 21:00:36 +00:00
Gordon Henriksen
64b6555e60
Deleting some unnecessary glue.
...
llvm-svn: 42702
2007-10-06 17:10:44 +00:00
Gordon Henriksen
36d61a4b79
Adopting a uniform naming convention for type constructors in
...
bindings (part le deux).
llvm-svn: 42701
2007-10-06 16:56:09 +00:00
Gordon Henriksen
ee9c8932e4
Adopting a uniform naming convention for type constructors in bindings.
...
llvm-svn: 42698
2007-10-06 16:05:20 +00:00
Gordon Henriksen
574434313a
Adopting a uniform naming convention for constant constructors in bindings.
...
llvm-svn: 42697
2007-10-06 15:11:06 +00:00
Gordon Henriksen
65ce7c3085
Adding C and Ocaml bindings for ConstantExpr.
...
llvm-svn: 42696
2007-10-06 14:29:36 +00:00
Gordon Henriksen
8d97ababb0
Wrapping Value::dump.
...
llvm-svn: 42668
2007-10-06 00:08:49 +00:00
Gordon Henriksen
e2d253991d
Do use the actual ocaml stdlib (not the install dir) to find the
...
caml/*.h headers.
llvm-svn: 42599
2007-10-04 00:07:50 +00:00
Gordon Henriksen
eca47fe7df
Providing --with-ocaml-libdir for ./configure. The default is the
...
stdlib if it's beneath --prefix, and is libdir/ocaml otherwise.
If someone has a better way than this to test whether $B is a path
within $A, I'd love to hear it:
if test "$A" \< "$B" -a "$B" \< "${A}~"
llvm-svn: 42532
2007-10-02 16:42:10 +00:00
Gordon Henriksen
7e22335299
Add explicit --enable-bindings option to configure.
...
llvm-svn: 42526
2007-10-02 09:50:18 +00:00
Gordon Henriksen
368316dc1c
Remove debugging.
...
llvm-svn: 42385
2007-09-27 02:47:27 +00:00
Gordon Henriksen
c73d5c73a6
Added C and Ocaml bindings for functions, basic blocks, and
...
instruction creation. No support yet for instruction introspection.
Also eliminated allocas from the Ocaml bindings for portability,
and avoided unnecessary casts.
llvm-svn: 42367
2007-09-26 20:56:12 +00:00
Gordon Henriksen
7b659bff9c
Fix srcdir <> objdir builds with ocaml 2.10. Downrev versions don't care whether
...
'dir' exists in 'ocamldep -I dir ...', but recent ones demand that it actually
exists.
llvm-svn: 42245
2007-09-23 13:37:44 +00:00
Gordon Henriksen
0728757caf
Incorporating review feedback for GC verifier patch.
...
llvm-svn: 42163
2007-09-20 16:47:41 +00:00
Gabor Greif
d65f36fb5d
use typenames equivalent to
...
(u)intval, because latter are not
present in older caml/mlvalues.h
(e.g. 2004/07/07, 1.48.6.1)
Using this as a workaround for now,
until --without-ocaml works
or we settle on a better solution
llvm-svn: 42160
2007-09-20 10:20:34 +00:00
Gabor Greif
b366bd7fb6
include alloca.h if available. this helps Solaris, but intnat and uintnat types are still undefined, causing errors
...
llvm-svn: 42129
2007-09-19 09:29:58 +00:00
Gordon Henriksen
9deea8ed1a
Tests of the ocaml (and thus C) bindings for constants.
...
llvm-svn: 42101
2007-09-18 18:07:51 +00:00
Gordon Henriksen
29fe360b5a
Adding ocaml language bindings for the vmcore and bitwriter libraries. These are
...
built atop the C language bindings, and user programs can link with them as
such:
# Bytecode
ocamlc -cc g++ llvm.cma llvmbitwriter.cma -o example example.ml
# Native
ocamlopt -cc g++ llvm.cmxa llvmbitwriter.cmxa -o example.opt example.ml
The vmcore.ml test exercises most/all of the APIs thus far bound. Unfortunately,
they're not yet numerous enough to write hello world. But:
$ cat example.ml
(* example.ml *)
open Llvm
open Llvm_bitwriter
let _ =
let filename = Sys.argv.(1) in
let m = create_module filename in
let v = make_int_constant i32_type 42 false in
let g = define_global "hello_world" v m in
if not (write_bitcode_file m filename) then exit 1;
dispose_module m;
$ ocamlc -cc g++ llvm.cma llvm_bitwriter.cma -o example example.ml
File "example.ml", line 11, characters 6-7:
Warning Y: unused variable g.
$ ./example example.bc
$ llvm-dis < example.bc
; ModuleID = '<stdin>'
@hello_world = global i32 42 ; <i32*> [#uses=0]
The ocaml test cases provide effective tests for the C interfaces.
llvm-svn: 42093
2007-09-18 12:49:39 +00:00
Gordon Henriksen
a8db66a37a
(no commit message)
...
llvm-svn: 42090
2007-09-18 12:26:17 +00:00