/
LLVMTypeRef.cs
136 lines (111 loc) · 2.98 KB
/
LLVMTypeRef.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
namespace LLVMSharp
{
using System;
using System.Runtime.InteropServices;
partial struct LLVMTypeRef
{
public LLVMTypeKind TypeKind
{
get { return LLVM.GetTypeKind(this); }
}
public bool TypeIsSized
{
get { return LLVM.TypeIsSized(this); }
}
public LLVMContextRef GetTypeContext()
{
return LLVM.GetTypeContext(this);
}
public void Dump()
{
LLVM.DumpType(this);
}
public string PrintTypeToString()
{
IntPtr ptr = LLVM.PrintTypeToString(this);
string retval = Marshal.PtrToStringAnsi(ptr) ?? "";
LLVM.DisposeMessage(ptr);
return retval;
}
public uint GetIntTypeWidth()
{
return LLVM.GetIntTypeWidth(this);
}
public bool IsFunctionVarArg
{
get { return LLVM.IsFunctionVarArg(this); }
}
public LLVMTypeRef GetReturnType()
{
return LLVM.GetReturnType(this);
}
public uint CountParamTypes()
{
return LLVM.CountParamTypes(this);
}
public LLVMTypeRef[] GetParamTypes()
{
return LLVM.GetParamTypes(this);
}
public string GetStructName()
{
return LLVM.GetStructName(this);
}
public void StructSetBody(LLVMTypeRef[] @ElementTypes, bool @Packed)
{
LLVM.StructSetBody(this, @ElementTypes, @Packed);
}
public uint CountStructElementTypes()
{
return LLVM.CountStructElementTypes(this);
}
public LLVMTypeRef[] GetStructElementTypes()
{
return LLVM.GetStructElementTypes(this);
}
public bool IsPackedStruct
{
get { return LLVM.IsPackedStruct(this); }
}
public bool IsOpaqueStruct
{
get { return LLVM.IsOpaqueStruct(this); }
}
public LLVMTypeRef GetElementType()
{
return LLVM.GetElementType(this);
}
public uint GetArrayLength()
{
return LLVM.GetArrayLength(this);
}
public uint GetPointerAddressSpace()
{
return LLVM.GetPointerAddressSpace(this);
}
public uint GetVectorSize()
{
return LLVM.GetVectorSize(this);
}
public LLVMValueRef GetUndef()
{
return LLVM.GetUndef(this);
}
public LLVMValueRef AlignOf()
{
return LLVM.AlignOf(this);
}
public LLVMValueRef SizeOf()
{
return LLVM.SizeOf(this);
}
public double GenericValueToFloat(LLVMGenericValueRef @GenVal)
{
return LLVM.GenericValueToFloat(this, @GenVal);
}
public override string ToString()
{
return this.PrintTypeToString();
}
}
}