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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42093 91177308-0d34-0410-b5e6-96231b3b80d8
make check-one TESTONE=test/path/to/test.ll
This runs a single check in exactly the same way that dejagnu runs it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36049 91177308-0d34-0410-b5e6-96231b3b80d8
premature, these libraries will be going away for the 2.0 release. Other
arrangements for profiling, gc, etc. should be made in the next few months.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31807 91177308-0d34-0410-b5e6-96231b3b80d8
suite is disabled by default because of the length of time it takes to
run. To enable it certain command line fu must be used. This patch just
encodes the command line fu as the magical "check-llvm2cpp" target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28626 91177308-0d34-0410-b5e6-96231b3b80d8
1. Remove the LLVM_DO_NOT_BUILD feature (not needed any more)
2. Ensure that lib/VMCore gets built first. This needs to be done because
VMCore now uses tblgen to generate the Intrinsics header which are
needed in other libraries. In parallel builds, this can cause problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28374 91177308-0d34-0410-b5e6-96231b3b80d8
1. Make setting OPTIONAL_DIRS use immediate assignment
2. Include Makefile.config before ifeq tests and then Makefile.rules later
instead of Makefile.common up front. This ensures that the variable
values are set before the ifeq statements in Makefile.rules are
evaluated.
With this, recursion into projects/examples is corrected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27519 91177308-0d34-0410-b5e6-96231b3b80d8
3. This ensures that if llvm-gcc isn't available and consequently the value
of LLVMGCC_MAJVERS is blank, that the old (include runtime) behavior will
persist.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27499 91177308-0d34-0410-b5e6-96231b3b80d8
Move the implementation of the fix from Makefile.rules to Makefile. This
ensures that it is only checked on a top-level rebuild, and not in every
single subdirectory. This removes some annoying messages from the build and
numerous executions of config.status if the .in file changes but not
substantively enough to cause the .h file to be modified by config.status.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23039 91177308-0d34-0410-b5e6-96231b3b80d8
1. Allow DIST_CHECK_CONFIG_OPTION to specify a set of options to be passed
to the configure script during the dist-check target. This allows things
to be passed down on a project basis so the configure doesn't fail.
2. Use the tar | (cd ; tar ) idiom to copy files which is more flexible
than using the cp command. THis allows us to exclude CVS .svn
directories at source rather than stripping them out of the tar ball.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22166 91177308-0d34-0410-b5e6-96231b3b80d8
* "dist" target now builds tar.gz, tar.bz2, and zip files suitable for
distribution. "dist" can only be run from $(BUILD_OBJ_ROOT) and implies
a "check".
* made the preconditions not do a recursive make and ensured that they are
executed sequentially.
* made the messages output by the makefile be prefixed with "llvm" and the
make level (e.g. llvm[1]: ) in the same way that make does so that the
messages are uniform and more readable.
* Fixed the tags target so that tags depends on TAGS which contains the
rules to build a file named TAGS
* Implemented the EXTRA_DIST feature in a few directories to make sure it
works.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17210 91177308-0d34-0410-b5e6-96231b3b80d8