Fork of llvm with experimental commits and workarounds for RPCS3
Go to file
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
autoconf (no commit message) 2007-09-18 12:26:59 +00:00
bindings Adding ocaml language bindings for the vmcore and bitwriter libraries. These are 2007-09-18 12:49:39 +00:00
docs
examples
include
lib
projects
runtime
test Adding ocaml language bindings for the vmcore and bitwriter libraries. These are 2007-09-18 12:49:39 +00:00
tools
utils
website
win32
Xcode
build-for-llvm-top.sh
configure Regenerate. 2007-09-18 12:27:13 +00:00
CREDITS.TXT
LICENSE.TXT
llvm.spec.in
Makefile Adding ocaml language bindings for the vmcore and bitwriter libraries. These are 2007-09-18 12:49:39 +00:00
Makefile.common
Makefile.config.in
Makefile.rules
ModuleInfo.txt
README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for the Low Level 
Virtual Machine, a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments. 

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the HTML documentation provided in docs/index.html for further
assistance with LLVM.