comparison tools/binding/llvm/c/Ext.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 // Written in the D programming language by Tomas Lindquist Olsen 2008
2 // Extensions to the LLVM C interface for the D binding.
3 //
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
6 //
7 module llvm.c.Ext;
8
9 import llvm.c.Core;
10
11 // taken from llvm/Value.h
12 /// An enumeration for keeping track of the concrete subclass of Value that
13 /// is actually instantiated. Values of this enumeration are kept in the
14 /// Value classes SubclassID field. They are used for concrete type
15 /// identification.
16 enum LLVMValueKind : uint
17 {
18 Argument, /// This is an instance of Argument
19 BasicBlock, /// This is an instance of BasicBlock
20 Function, /// This is an instance of Function
21 GlobalAlias, /// This is an instance of GlobalAlias
22 GlobalVariable, /// This is an instance of GlobalVariable
23 UndefValue, /// This is an instance of UndefValue
24 ConstantExpr, /// This is an instance of ConstantExpr
25 ConstantAggregateZero, /// This is an instance of ConstantAggregateNull
26 ConstantInt, /// This is an instance of ConstantInt
27 ConstantFP, /// This is an instance of ConstantFP
28 ConstantArray, /// This is an instance of ConstantArray
29 ConstantStruct, /// This is an instance of ConstantStruct
30 ConstantVector, /// This is an instance of ConstantVector
31 ConstantPointerNull, /// This is an instance of ConstantPointerNull
32 InlineAsm, /// This is an instance of InlineAsm
33 Instruction /// This is an instance of Instruction
34 }
35
36 extern(C)
37 {
38 void LLVMEraseFromParent(LLVMValueRef I);
39 int LLVMIsTerminated(LLVMBasicBlockRef BB);
40 int LLVMHasPredecessors(LLVMBasicBlockRef BB);
41 int LLVMIsBasicBlockEmpty(LLVMBasicBlockRef BB);
42 void LLVMReplaceAllUsesWith(LLVMValueRef V, LLVMValueRef W);
43
44 void LLVMOptimizeModule(LLVMModuleRef M, int doinline);
45 void LLVMDumpType(LLVMTypeRef T);
46
47 LLVMValueRef LLVMGetOrInsertFunction(LLVMModuleRef M, char* Name, LLVMTypeRef Type);
48
49 /// Return a strdup()ed string which must be free()ed
50 char* LLVMValueToString(LLVMValueRef v);
51 char* LLVMTypeToString(LLVMTypeRef ty); /// ditto
52
53 LLVMValueKind LLVMGetValueKind(LLVMValueRef Value);
54
55 LLVMTypeRef LLVMGetTypeByName(LLVMModuleRef M, char* Name);
56 int LLVMIsTypeAbstract(LLVMTypeRef T);
57
58 alias void function(void* handle, LLVMTypeRef newT) RefineCallback;
59 void LLVMRegisterAbstractTypeCallback(LLVMTypeRef T,
60 void* handle,
61 RefineCallback callback);
62 }