xref: /aosp_15_r20/external/llvm/include/llvm-c/Target.h (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker /*===-- llvm-c/Target.h - Target Lib C Iface --------------------*- C++ -*-===*/
2*9880d681SAndroid Build Coastguard Worker /*                                                                            */
3*9880d681SAndroid Build Coastguard Worker /*                     The LLVM Compiler Infrastructure                       */
4*9880d681SAndroid Build Coastguard Worker /*                                                                            */
5*9880d681SAndroid Build Coastguard Worker /* This file is distributed under the University of Illinois Open Source      */
6*9880d681SAndroid Build Coastguard Worker /* License. See LICENSE.TXT for details.                                      */
7*9880d681SAndroid Build Coastguard Worker /*                                                                            */
8*9880d681SAndroid Build Coastguard Worker /*===----------------------------------------------------------------------===*/
9*9880d681SAndroid Build Coastguard Worker /*                                                                            */
10*9880d681SAndroid Build Coastguard Worker /* This header declares the C interface to libLLVMTarget.a, which             */
11*9880d681SAndroid Build Coastguard Worker /* implements target information.                                             */
12*9880d681SAndroid Build Coastguard Worker /*                                                                            */
13*9880d681SAndroid Build Coastguard Worker /* Many exotic languages can interoperate with C code but have a harder time  */
14*9880d681SAndroid Build Coastguard Worker /* with C++ due to name mangling. So in addition to C, this interface enables */
15*9880d681SAndroid Build Coastguard Worker /* tools written in such languages.                                           */
16*9880d681SAndroid Build Coastguard Worker /*                                                                            */
17*9880d681SAndroid Build Coastguard Worker /*===----------------------------------------------------------------------===*/
18*9880d681SAndroid Build Coastguard Worker 
19*9880d681SAndroid Build Coastguard Worker #ifndef LLVM_C_TARGET_H
20*9880d681SAndroid Build Coastguard Worker #define LLVM_C_TARGET_H
21*9880d681SAndroid Build Coastguard Worker 
22*9880d681SAndroid Build Coastguard Worker #include "llvm-c/Types.h"
23*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/llvm-config.h"
24*9880d681SAndroid Build Coastguard Worker 
25*9880d681SAndroid Build Coastguard Worker #if defined(_MSC_VER) && !defined(inline)
26*9880d681SAndroid Build Coastguard Worker #define inline __inline
27*9880d681SAndroid Build Coastguard Worker #endif
28*9880d681SAndroid Build Coastguard Worker 
29*9880d681SAndroid Build Coastguard Worker #ifdef __cplusplus
30*9880d681SAndroid Build Coastguard Worker extern "C" {
31*9880d681SAndroid Build Coastguard Worker #endif
32*9880d681SAndroid Build Coastguard Worker 
33*9880d681SAndroid Build Coastguard Worker /**
34*9880d681SAndroid Build Coastguard Worker  * @defgroup LLVMCTarget Target information
35*9880d681SAndroid Build Coastguard Worker  * @ingroup LLVMC
36*9880d681SAndroid Build Coastguard Worker  *
37*9880d681SAndroid Build Coastguard Worker  * @{
38*9880d681SAndroid Build Coastguard Worker  */
39*9880d681SAndroid Build Coastguard Worker 
40*9880d681SAndroid Build Coastguard Worker enum LLVMByteOrdering { LLVMBigEndian, LLVMLittleEndian };
41*9880d681SAndroid Build Coastguard Worker 
42*9880d681SAndroid Build Coastguard Worker typedef struct LLVMOpaqueTargetData *LLVMTargetDataRef;
43*9880d681SAndroid Build Coastguard Worker typedef struct LLVMOpaqueTargetLibraryInfotData *LLVMTargetLibraryInfoRef;
44*9880d681SAndroid Build Coastguard Worker 
45*9880d681SAndroid Build Coastguard Worker /* Declare all of the target-initialization functions that are available. */
46*9880d681SAndroid Build Coastguard Worker #define LLVM_TARGET(TargetName) \
47*9880d681SAndroid Build Coastguard Worker   void LLVMInitialize##TargetName##TargetInfo(void);
48*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/Targets.def"
49*9880d681SAndroid Build Coastguard Worker #undef LLVM_TARGET  /* Explicit undef to make SWIG happier */
50*9880d681SAndroid Build Coastguard Worker 
51*9880d681SAndroid Build Coastguard Worker #define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target(void);
52*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/Targets.def"
53*9880d681SAndroid Build Coastguard Worker #undef LLVM_TARGET  /* Explicit undef to make SWIG happier */
54*9880d681SAndroid Build Coastguard Worker 
55*9880d681SAndroid Build Coastguard Worker #define LLVM_TARGET(TargetName) \
56*9880d681SAndroid Build Coastguard Worker   void LLVMInitialize##TargetName##TargetMC(void);
57*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/Targets.def"
58*9880d681SAndroid Build Coastguard Worker #undef LLVM_TARGET  /* Explicit undef to make SWIG happier */
59*9880d681SAndroid Build Coastguard Worker 
60*9880d681SAndroid Build Coastguard Worker /* Declare all of the available assembly printer initialization functions. */
61*9880d681SAndroid Build Coastguard Worker #define LLVM_ASM_PRINTER(TargetName) \
62*9880d681SAndroid Build Coastguard Worker   void LLVMInitialize##TargetName##AsmPrinter(void);
63*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/AsmPrinters.def"
64*9880d681SAndroid Build Coastguard Worker #undef LLVM_ASM_PRINTER  /* Explicit undef to make SWIG happier */
65*9880d681SAndroid Build Coastguard Worker 
66*9880d681SAndroid Build Coastguard Worker /* Declare all of the available assembly parser initialization functions. */
67*9880d681SAndroid Build Coastguard Worker #define LLVM_ASM_PARSER(TargetName) \
68*9880d681SAndroid Build Coastguard Worker   void LLVMInitialize##TargetName##AsmParser(void);
69*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/AsmParsers.def"
70*9880d681SAndroid Build Coastguard Worker #undef LLVM_ASM_PARSER  /* Explicit undef to make SWIG happier */
71*9880d681SAndroid Build Coastguard Worker 
72*9880d681SAndroid Build Coastguard Worker /* Declare all of the available disassembler initialization functions. */
73*9880d681SAndroid Build Coastguard Worker #define LLVM_DISASSEMBLER(TargetName) \
74*9880d681SAndroid Build Coastguard Worker   void LLVMInitialize##TargetName##Disassembler(void);
75*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/Disassemblers.def"
76*9880d681SAndroid Build Coastguard Worker #undef LLVM_DISASSEMBLER  /* Explicit undef to make SWIG happier */
77*9880d681SAndroid Build Coastguard Worker 
78*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeAllTargetInfos - The main program should call this function if
79*9880d681SAndroid Build Coastguard Worker     it wants access to all available targets that LLVM is configured to
80*9880d681SAndroid Build Coastguard Worker     support. */
LLVMInitializeAllTargetInfos(void)81*9880d681SAndroid Build Coastguard Worker static inline void LLVMInitializeAllTargetInfos(void) {
82*9880d681SAndroid Build Coastguard Worker #define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetInfo();
83*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/Targets.def"
84*9880d681SAndroid Build Coastguard Worker #undef LLVM_TARGET  /* Explicit undef to make SWIG happier */
85*9880d681SAndroid Build Coastguard Worker }
86*9880d681SAndroid Build Coastguard Worker 
87*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeAllTargets - The main program should call this function if it
88*9880d681SAndroid Build Coastguard Worker     wants to link in all available targets that LLVM is configured to
89*9880d681SAndroid Build Coastguard Worker     support. */
LLVMInitializeAllTargets(void)90*9880d681SAndroid Build Coastguard Worker static inline void LLVMInitializeAllTargets(void) {
91*9880d681SAndroid Build Coastguard Worker #define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
92*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/Targets.def"
93*9880d681SAndroid Build Coastguard Worker #undef LLVM_TARGET  /* Explicit undef to make SWIG happier */
94*9880d681SAndroid Build Coastguard Worker }
95*9880d681SAndroid Build Coastguard Worker 
96*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeAllTargetMCs - The main program should call this function if
97*9880d681SAndroid Build Coastguard Worker     it wants access to all available target MC that LLVM is configured to
98*9880d681SAndroid Build Coastguard Worker     support. */
LLVMInitializeAllTargetMCs(void)99*9880d681SAndroid Build Coastguard Worker static inline void LLVMInitializeAllTargetMCs(void) {
100*9880d681SAndroid Build Coastguard Worker #define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetMC();
101*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/Targets.def"
102*9880d681SAndroid Build Coastguard Worker #undef LLVM_TARGET  /* Explicit undef to make SWIG happier */
103*9880d681SAndroid Build Coastguard Worker }
104*9880d681SAndroid Build Coastguard Worker 
105*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeAllAsmPrinters - The main program should call this function if
106*9880d681SAndroid Build Coastguard Worker     it wants all asm printers that LLVM is configured to support, to make them
107*9880d681SAndroid Build Coastguard Worker     available via the TargetRegistry. */
LLVMInitializeAllAsmPrinters(void)108*9880d681SAndroid Build Coastguard Worker static inline void LLVMInitializeAllAsmPrinters(void) {
109*9880d681SAndroid Build Coastguard Worker #define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter();
110*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/AsmPrinters.def"
111*9880d681SAndroid Build Coastguard Worker #undef LLVM_ASM_PRINTER  /* Explicit undef to make SWIG happier */
112*9880d681SAndroid Build Coastguard Worker }
113*9880d681SAndroid Build Coastguard Worker 
114*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeAllAsmParsers - The main program should call this function if
115*9880d681SAndroid Build Coastguard Worker     it wants all asm parsers that LLVM is configured to support, to make them
116*9880d681SAndroid Build Coastguard Worker     available via the TargetRegistry. */
LLVMInitializeAllAsmParsers(void)117*9880d681SAndroid Build Coastguard Worker static inline void LLVMInitializeAllAsmParsers(void) {
118*9880d681SAndroid Build Coastguard Worker #define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser();
119*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/AsmParsers.def"
120*9880d681SAndroid Build Coastguard Worker #undef LLVM_ASM_PARSER  /* Explicit undef to make SWIG happier */
121*9880d681SAndroid Build Coastguard Worker }
122*9880d681SAndroid Build Coastguard Worker 
123*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeAllDisassemblers - The main program should call this function
124*9880d681SAndroid Build Coastguard Worker     if it wants all disassemblers that LLVM is configured to support, to make
125*9880d681SAndroid Build Coastguard Worker     them available via the TargetRegistry. */
LLVMInitializeAllDisassemblers(void)126*9880d681SAndroid Build Coastguard Worker static inline void LLVMInitializeAllDisassemblers(void) {
127*9880d681SAndroid Build Coastguard Worker #define LLVM_DISASSEMBLER(TargetName) \
128*9880d681SAndroid Build Coastguard Worker   LLVMInitialize##TargetName##Disassembler();
129*9880d681SAndroid Build Coastguard Worker #include "llvm/Config/Disassemblers.def"
130*9880d681SAndroid Build Coastguard Worker #undef LLVM_DISASSEMBLER  /* Explicit undef to make SWIG happier */
131*9880d681SAndroid Build Coastguard Worker }
132*9880d681SAndroid Build Coastguard Worker 
133*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeNativeTarget - The main program should call this function to
134*9880d681SAndroid Build Coastguard Worker     initialize the native target corresponding to the host.  This is useful
135*9880d681SAndroid Build Coastguard Worker     for JIT applications to ensure that the target gets linked in correctly. */
LLVMInitializeNativeTarget(void)136*9880d681SAndroid Build Coastguard Worker static inline LLVMBool LLVMInitializeNativeTarget(void) {
137*9880d681SAndroid Build Coastguard Worker   /* If we have a native target, initialize it to ensure it is linked in. */
138*9880d681SAndroid Build Coastguard Worker #ifdef LLVM_NATIVE_TARGET
139*9880d681SAndroid Build Coastguard Worker   LLVM_NATIVE_TARGETINFO();
140*9880d681SAndroid Build Coastguard Worker   LLVM_NATIVE_TARGET();
141*9880d681SAndroid Build Coastguard Worker   LLVM_NATIVE_TARGETMC();
142*9880d681SAndroid Build Coastguard Worker   return 0;
143*9880d681SAndroid Build Coastguard Worker #else
144*9880d681SAndroid Build Coastguard Worker   return 1;
145*9880d681SAndroid Build Coastguard Worker #endif
146*9880d681SAndroid Build Coastguard Worker }
147*9880d681SAndroid Build Coastguard Worker 
148*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeNativeTargetAsmParser - The main program should call this
149*9880d681SAndroid Build Coastguard Worker     function to initialize the parser for the native target corresponding to the
150*9880d681SAndroid Build Coastguard Worker     host. */
LLVMInitializeNativeAsmParser(void)151*9880d681SAndroid Build Coastguard Worker static inline LLVMBool LLVMInitializeNativeAsmParser(void) {
152*9880d681SAndroid Build Coastguard Worker #ifdef LLVM_NATIVE_ASMPARSER
153*9880d681SAndroid Build Coastguard Worker   LLVM_NATIVE_ASMPARSER();
154*9880d681SAndroid Build Coastguard Worker   return 0;
155*9880d681SAndroid Build Coastguard Worker #else
156*9880d681SAndroid Build Coastguard Worker   return 1;
157*9880d681SAndroid Build Coastguard Worker #endif
158*9880d681SAndroid Build Coastguard Worker }
159*9880d681SAndroid Build Coastguard Worker 
160*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeNativeTargetAsmPrinter - The main program should call this
161*9880d681SAndroid Build Coastguard Worker     function to initialize the printer for the native target corresponding to
162*9880d681SAndroid Build Coastguard Worker     the host. */
LLVMInitializeNativeAsmPrinter(void)163*9880d681SAndroid Build Coastguard Worker static inline LLVMBool LLVMInitializeNativeAsmPrinter(void) {
164*9880d681SAndroid Build Coastguard Worker #ifdef LLVM_NATIVE_ASMPRINTER
165*9880d681SAndroid Build Coastguard Worker   LLVM_NATIVE_ASMPRINTER();
166*9880d681SAndroid Build Coastguard Worker   return 0;
167*9880d681SAndroid Build Coastguard Worker #else
168*9880d681SAndroid Build Coastguard Worker   return 1;
169*9880d681SAndroid Build Coastguard Worker #endif
170*9880d681SAndroid Build Coastguard Worker }
171*9880d681SAndroid Build Coastguard Worker 
172*9880d681SAndroid Build Coastguard Worker /** LLVMInitializeNativeTargetDisassembler - The main program should call this
173*9880d681SAndroid Build Coastguard Worker     function to initialize the disassembler for the native target corresponding
174*9880d681SAndroid Build Coastguard Worker     to the host. */
LLVMInitializeNativeDisassembler(void)175*9880d681SAndroid Build Coastguard Worker static inline LLVMBool LLVMInitializeNativeDisassembler(void) {
176*9880d681SAndroid Build Coastguard Worker #ifdef LLVM_NATIVE_DISASSEMBLER
177*9880d681SAndroid Build Coastguard Worker   LLVM_NATIVE_DISASSEMBLER();
178*9880d681SAndroid Build Coastguard Worker   return 0;
179*9880d681SAndroid Build Coastguard Worker #else
180*9880d681SAndroid Build Coastguard Worker   return 1;
181*9880d681SAndroid Build Coastguard Worker #endif
182*9880d681SAndroid Build Coastguard Worker }
183*9880d681SAndroid Build Coastguard Worker 
184*9880d681SAndroid Build Coastguard Worker /*===-- Target Data -------------------------------------------------------===*/
185*9880d681SAndroid Build Coastguard Worker 
186*9880d681SAndroid Build Coastguard Worker /**
187*9880d681SAndroid Build Coastguard Worker  * Obtain the data layout for a module.
188*9880d681SAndroid Build Coastguard Worker  *
189*9880d681SAndroid Build Coastguard Worker  * @see Module::getDataLayout()
190*9880d681SAndroid Build Coastguard Worker  */
191*9880d681SAndroid Build Coastguard Worker LLVMTargetDataRef LLVMGetModuleDataLayout(LLVMModuleRef M);
192*9880d681SAndroid Build Coastguard Worker 
193*9880d681SAndroid Build Coastguard Worker /**
194*9880d681SAndroid Build Coastguard Worker  * Set the data layout for a module.
195*9880d681SAndroid Build Coastguard Worker  *
196*9880d681SAndroid Build Coastguard Worker  * @see Module::setDataLayout()
197*9880d681SAndroid Build Coastguard Worker  */
198*9880d681SAndroid Build Coastguard Worker void LLVMSetModuleDataLayout(LLVMModuleRef M, LLVMTargetDataRef DL);
199*9880d681SAndroid Build Coastguard Worker 
200*9880d681SAndroid Build Coastguard Worker /** Creates target data from a target layout string.
201*9880d681SAndroid Build Coastguard Worker     See the constructor llvm::DataLayout::DataLayout. */
202*9880d681SAndroid Build Coastguard Worker LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep);
203*9880d681SAndroid Build Coastguard Worker 
204*9880d681SAndroid Build Coastguard Worker /** Deallocates a TargetData.
205*9880d681SAndroid Build Coastguard Worker     See the destructor llvm::DataLayout::~DataLayout. */
206*9880d681SAndroid Build Coastguard Worker void LLVMDisposeTargetData(LLVMTargetDataRef TD);
207*9880d681SAndroid Build Coastguard Worker 
208*9880d681SAndroid Build Coastguard Worker /** Adds target library information to a pass manager. This does not take
209*9880d681SAndroid Build Coastguard Worker     ownership of the target library info.
210*9880d681SAndroid Build Coastguard Worker     See the method llvm::PassManagerBase::add. */
211*9880d681SAndroid Build Coastguard Worker void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI,
212*9880d681SAndroid Build Coastguard Worker                               LLVMPassManagerRef PM);
213*9880d681SAndroid Build Coastguard Worker 
214*9880d681SAndroid Build Coastguard Worker /** Converts target data to a target layout string. The string must be disposed
215*9880d681SAndroid Build Coastguard Worker     with LLVMDisposeMessage.
216*9880d681SAndroid Build Coastguard Worker     See the constructor llvm::DataLayout::DataLayout. */
217*9880d681SAndroid Build Coastguard Worker char *LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD);
218*9880d681SAndroid Build Coastguard Worker 
219*9880d681SAndroid Build Coastguard Worker /** Returns the byte order of a target, either LLVMBigEndian or
220*9880d681SAndroid Build Coastguard Worker     LLVMLittleEndian.
221*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::isLittleEndian. */
222*9880d681SAndroid Build Coastguard Worker enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD);
223*9880d681SAndroid Build Coastguard Worker 
224*9880d681SAndroid Build Coastguard Worker /** Returns the pointer size in bytes for a target.
225*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getPointerSize. */
226*9880d681SAndroid Build Coastguard Worker unsigned LLVMPointerSize(LLVMTargetDataRef TD);
227*9880d681SAndroid Build Coastguard Worker 
228*9880d681SAndroid Build Coastguard Worker /** Returns the pointer size in bytes for a target for a specified
229*9880d681SAndroid Build Coastguard Worker     address space.
230*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getPointerSize. */
231*9880d681SAndroid Build Coastguard Worker unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS);
232*9880d681SAndroid Build Coastguard Worker 
233*9880d681SAndroid Build Coastguard Worker /** Returns the integer type that is the same size as a pointer on a target.
234*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getIntPtrType. */
235*9880d681SAndroid Build Coastguard Worker LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD);
236*9880d681SAndroid Build Coastguard Worker 
237*9880d681SAndroid Build Coastguard Worker /** Returns the integer type that is the same size as a pointer on a target.
238*9880d681SAndroid Build Coastguard Worker     This version allows the address space to be specified.
239*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getIntPtrType. */
240*9880d681SAndroid Build Coastguard Worker LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS);
241*9880d681SAndroid Build Coastguard Worker 
242*9880d681SAndroid Build Coastguard Worker /** Returns the integer type that is the same size as a pointer on a target.
243*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getIntPtrType. */
244*9880d681SAndroid Build Coastguard Worker LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD);
245*9880d681SAndroid Build Coastguard Worker 
246*9880d681SAndroid Build Coastguard Worker /** Returns the integer type that is the same size as a pointer on a target.
247*9880d681SAndroid Build Coastguard Worker     This version allows the address space to be specified.
248*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getIntPtrType. */
249*9880d681SAndroid Build Coastguard Worker LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD,
250*9880d681SAndroid Build Coastguard Worker                                          unsigned AS);
251*9880d681SAndroid Build Coastguard Worker 
252*9880d681SAndroid Build Coastguard Worker /** Computes the size of a type in bytes for a target.
253*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getTypeSizeInBits. */
254*9880d681SAndroid Build Coastguard Worker unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty);
255*9880d681SAndroid Build Coastguard Worker 
256*9880d681SAndroid Build Coastguard Worker /** Computes the storage size of a type in bytes for a target.
257*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getTypeStoreSize. */
258*9880d681SAndroid Build Coastguard Worker unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
259*9880d681SAndroid Build Coastguard Worker 
260*9880d681SAndroid Build Coastguard Worker /** Computes the ABI size of a type in bytes for a target.
261*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getTypeAllocSize. */
262*9880d681SAndroid Build Coastguard Worker unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
263*9880d681SAndroid Build Coastguard Worker 
264*9880d681SAndroid Build Coastguard Worker /** Computes the ABI alignment of a type in bytes for a target.
265*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getTypeABISize. */
266*9880d681SAndroid Build Coastguard Worker unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
267*9880d681SAndroid Build Coastguard Worker 
268*9880d681SAndroid Build Coastguard Worker /** Computes the call frame alignment of a type in bytes for a target.
269*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getTypeABISize. */
270*9880d681SAndroid Build Coastguard Worker unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
271*9880d681SAndroid Build Coastguard Worker 
272*9880d681SAndroid Build Coastguard Worker /** Computes the preferred alignment of a type in bytes for a target.
273*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getTypeABISize. */
274*9880d681SAndroid Build Coastguard Worker unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty);
275*9880d681SAndroid Build Coastguard Worker 
276*9880d681SAndroid Build Coastguard Worker /** Computes the preferred alignment of a global variable in bytes for a target.
277*9880d681SAndroid Build Coastguard Worker     See the method llvm::DataLayout::getPreferredAlignment. */
278*9880d681SAndroid Build Coastguard Worker unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD,
279*9880d681SAndroid Build Coastguard Worker                                         LLVMValueRef GlobalVar);
280*9880d681SAndroid Build Coastguard Worker 
281*9880d681SAndroid Build Coastguard Worker /** Computes the structure element that contains the byte offset for a target.
282*9880d681SAndroid Build Coastguard Worker     See the method llvm::StructLayout::getElementContainingOffset. */
283*9880d681SAndroid Build Coastguard Worker unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy,
284*9880d681SAndroid Build Coastguard Worker                              unsigned long long Offset);
285*9880d681SAndroid Build Coastguard Worker 
286*9880d681SAndroid Build Coastguard Worker /** Computes the byte offset of the indexed struct element for a target.
287*9880d681SAndroid Build Coastguard Worker     See the method llvm::StructLayout::getElementContainingOffset. */
288*9880d681SAndroid Build Coastguard Worker unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD,
289*9880d681SAndroid Build Coastguard Worker                                        LLVMTypeRef StructTy, unsigned Element);
290*9880d681SAndroid Build Coastguard Worker 
291*9880d681SAndroid Build Coastguard Worker /**
292*9880d681SAndroid Build Coastguard Worker  * @}
293*9880d681SAndroid Build Coastguard Worker  */
294*9880d681SAndroid Build Coastguard Worker 
295*9880d681SAndroid Build Coastguard Worker #ifdef __cplusplus
296*9880d681SAndroid Build Coastguard Worker }
297*9880d681SAndroid Build Coastguard Worker #endif /* defined(__cplusplus) */
298*9880d681SAndroid Build Coastguard Worker 
299*9880d681SAndroid Build Coastguard Worker #endif
300