comparison tools/binding/llvm/c/ExecutionEngine.d @ 1273:1ba61de8796b

Committing LLVM binding for D as it currently exists in the SVN repository.
author Frits van Bommel <fvbommel wxs.nl>
date Mon, 27 Apr 2009 22:33:17 +0200
parents
children
comparison
equal deleted inserted replaced
1272:dd4766851b37 1273:1ba61de8796b
1 // Converted to the D programming language by Tomas Lindquist Olsen 2008
2 // Original file header:
3 /*===-- llvm-c/ExecutionEngine.h - ExecutionEngine Lib C Iface --*- C++ -*-===*\
4 |* *|
5 |* The LLVM Compiler Infrastructure *|
6 |* *|
7 |* This file is distributed under the University of Illinois Open Source *|
8 |* License. See LICENSE.TXT for details. *|
9 |* *|
10 |*===----------------------------------------------------------------------===*|
11 |* *|
12 |* This header declares the C interface to libLLVMExecutionEngine.o, which *|
13 |* implements various analyses of the LLVM IR. *|
14 |* *|
15 |* Many exotic languages can interoperate with C code but have a harder time *|
16 |* with C++ due to name mangling. So in addition to C, this interface enables *|
17 |* tools written in such languages. *|
18 |* *|
19 \*===----------------------------------------------------------------------===*/
20
21 module llvm.c.ExecutionEngine;
22
23 import llvm.c.Core;
24
25 extern(C):
26
27 private
28 {
29 struct LLVM_OpaqueGenericValue {}
30 struct LLVM_OpaqueExecutionEngine {}
31 }
32
33 typedef LLVM_OpaqueGenericValue* LLVMGenericValueRef;
34 typedef LLVM_OpaqueExecutionEngine* LLVMExecutionEngineRef;
35
36 /*===-- Operations on generic values --------------------------------------===*/
37
38 LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty,
39 ulong N,
40 int IsSigned);
41
42 LLVMGenericValueRef LLVMCreateGenericValueOfPointer(void *P);
43
44 LLVMGenericValueRef LLVMCreateGenericValueOfFloat(LLVMTypeRef Ty, double N);
45
46 uint LLVMGenericValueIntWidth(LLVMGenericValueRef GenValRef);
47
48 ulong LLVMGenericValueToInt(LLVMGenericValueRef GenVal,
49 int IsSigned);
50
51 void *LLVMGenericValueToPointer(LLVMGenericValueRef GenVal);
52
53 double LLVMGenericValueToFloat(LLVMTypeRef TyRef, LLVMGenericValueRef GenVal);
54
55 void LLVMDisposeGenericValue(LLVMGenericValueRef GenVal);
56
57 /*===-- Operations on execution engines -----------------------------------===*/
58
59 int LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE,
60 LLVMModuleProviderRef MP,
61 char **OutError);
62
63 int LLVMCreateInterpreter(LLVMExecutionEngineRef *OutInterp,
64 LLVMModuleProviderRef MP,
65 char **OutError);
66
67 int LLVMCreateJITCompiler(LLVMExecutionEngineRef *OutJIT,
68 LLVMModuleProviderRef MP,
69 char **OutError);
70
71 void LLVMDisposeExecutionEngine(LLVMExecutionEngineRef EE);
72
73 void LLVMRunStaticConstructors(LLVMExecutionEngineRef EE);
74
75 void LLVMRunStaticDestructors(LLVMExecutionEngineRef EE);
76
77 int LLVMRunFunctionAsMain(LLVMExecutionEngineRef EE, LLVMValueRef F,
78 uint ArgC, /*const*/ char * /*const*/ *ArgV,
79 /*const*/ char * /*const*/ *EnvP);
80
81 LLVMGenericValueRef LLVMRunFunction(LLVMExecutionEngineRef EE, LLVMValueRef F,
82 uint NumArgs,
83 LLVMGenericValueRef *Args);
84
85 void LLVMFreeMachineCodeForFunction(LLVMExecutionEngineRef EE, LLVMValueRef F);
86
87 void LLVMAddModuleProvider(LLVMExecutionEngineRef EE, LLVMModuleProviderRef MP);
88
89 int LLVMRemoveModuleProvider(LLVMExecutionEngineRef EE,
90 LLVMModuleProviderRef MP,
91 LLVMModuleRef *OutMod, char **OutError);
92
93 int LLVMFindFunction(LLVMExecutionEngineRef EE, /*const*/ char *Name,
94 LLVMValueRef *OutFn);