llvm.org GIT mirror llvm / 53e7203
[OCaml] Add an ocamlfind package llvm.all_backends. This package is useful for architecture-independent tools like llc. Patch by Jacques-Pascal Deplaix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207793 91177308-0d34-0410-b5e6-96231b3b80d8 Peter Zotov 6 years ago
6 changed file(s) with 83 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
88
99 LEVEL := ../..
1010 DIRS = llvm bitreader bitwriter irreader analysis target executionengine \
11 transforms linker backends
11 transforms linker backends all_backends
1212 ExtraMakefiles = $(PROJ_OBJ_DIR)/Makefile.ocaml
1313
1414 ocamldoc:
0 ##===- bindings/ocaml/all_backends/Makefile ----------------------*- Makefile -*-===##
1 #
2 # The LLVM Compiler Infrastructure
3 #
4 # This file is distributed under the University of Illinois Open Source
5 # License. See LICENSE.TXT for details.
6 #
7 ##===----------------------------------------------------------------------===##
8 #
9 # This is the makefile for the Objective Caml Llvm_backends interface.
10 #
11 ##===----------------------------------------------------------------------===##
12
13 LEVEL := ../../..
14 include $(LEVEL)/Makefile.config
15
16 LIBRARYNAME := llvm_all_backends
17 UsedComponents := $(TARGETS_TO_BUILD)
18 UsedOcamlInterfaces :=
19
20 include ../Makefile.ocaml
0 /*===-- all_backends_ocaml.c - LLVM OCaml Glue ------------------*- C++ -*-===*\
1 |* *|
2 |* The LLVM Compiler Infrastructure *|
3 |* *|
4 |* This file is distributed under the University of Illinois Open Source *|
5 |* License. See LICENSE.TXT for details. *|
6 |* *|
7 |*===----------------------------------------------------------------------===*|
8 |* *|
9 |* This file glues LLVM's OCaml interface to its C interface. These functions *|
10 |* are by and large transparent wrappers to the corresponding C functions. *|
11 |* *|
12 |* Note that these functions intentionally take liberties with the CAMLparamX *|
13 |* macros, since most of the parameters are not GC heap objects. *|
14 |* *|
15 \*===----------------------------------------------------------------------===*/
16
17 #include "llvm-c/Target.h"
18 #include "caml/alloc.h"
19 #include "caml/fail.h"
20 #include "caml/memory.h"
21 #include "caml/custom.h"
22
23 /* unit -> unit */
24 CAMLprim value llvm_initialize_all(value Unit) {
25 LLVMInitializeAllTargetInfos();
26 LLVMInitializeAllTargets();
27 LLVMInitializeAllTargetMCs();
28 LLVMInitializeAllAsmPrinters();
29 LLVMInitializeAllAsmParsers();
30 return Val_unit;
31 }
0 (*===-- llvm_all_backends.ml - LLVM OCaml Interface -----------*- OCaml -*-===*
1 *
2 * The LLVM Compiler Infrastructure
3 *
4 * This file is distributed under the University of Illinois Open Source
5 * License. See LICENSE.TXT for details.
6 *
7 *===----------------------------------------------------------------------===*)
8
9 external initialize : unit -> unit = "llvm_initialize_all"
0 (*===-- llvm_all_backends.mli - LLVM OCaml Interface ----------*- OCaml -*-===*
1 *
2 * The LLVM Compiler Infrastructure
3 *
4 * This file is distributed under the University of Illinois Open Source
5 * License. See LICENSE.TXT for details.
6 *
7 *===----------------------------------------------------------------------===*)
8
9 (** Initialize all the backends targets *)
10 val initialize : unit -> unit
9292 archive(byte) = "llvm_linker.cma"
9393 archive(native) = "llvm_linker.cmxa"
9494 )
95
96 package "all_backends" (
97 requires = "llvm"
98 version = "@PACKAGE_VERSION@"
99 description = "All backends for LLVM"
100 archive(byte) = "llvm_all_backends.cma"
101 archive(native) = "llvm_all_backends.cmxa"
102 )