19 #ifndef LLVM_C_TARGET_H
20 #define LLVM_C_TARGET_H
23 #include "llvm/Config/llvm-config.h"
25 #if defined(_MSC_VER) && !defined(inline)
26 #define inline __inline
46 #define LLVM_TARGET(TargetName) \
47 void LLVMInitialize##TargetName##TargetInfo(void);
48 #include "llvm/Config/Targets.def"
51 #define LLVM_TARGET(TargetName) void LLVMInitialize##TargetName##Target(void);
52 #include "llvm/Config/Targets.def"
55 #define LLVM_TARGET(TargetName) \
56 void LLVMInitialize##TargetName##TargetMC(void);
57 #include "llvm/Config/Targets.def"
61 #define LLVM_ASM_PRINTER(TargetName) \
62 void LLVMInitialize##TargetName##AsmPrinter(void);
63 #include "llvm/Config/AsmPrinters.def"
64 #undef LLVM_ASM_PRINTER
67 #define LLVM_ASM_PARSER(TargetName) \
68 void LLVMInitialize##TargetName##AsmParser(void);
69 #include "llvm/Config/AsmParsers.def"
70 #undef LLVM_ASM_PARSER
73 #define LLVM_DISASSEMBLER(TargetName) \
74 void LLVMInitialize##TargetName##Disassembler(void);
75 #include "llvm/Config/Disassemblers.def"
76 #undef LLVM_DISASSEMBLER
82 #define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetInfo();
83 #include "llvm/Config/Targets.def"
91 #define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##Target();
92 #include "llvm/Config/Targets.def"
100 #define LLVM_TARGET(TargetName) LLVMInitialize##TargetName##TargetMC();
101 #include "llvm/Config/Targets.def"
109 #define LLVM_ASM_PRINTER(TargetName) LLVMInitialize##TargetName##AsmPrinter();
110 #include "llvm/Config/AsmPrinters.def"
111 #undef LLVM_ASM_PRINTER
118 #define LLVM_ASM_PARSER(TargetName) LLVMInitialize##TargetName##AsmParser();
119 #include "llvm/Config/AsmParsers.def"
120 #undef LLVM_ASM_PARSER
127 #define LLVM_DISASSEMBLER(TargetName) \
128 LLVMInitialize##TargetName##Disassembler();
129 #include "llvm/Config/Disassemblers.def"
130 #undef LLVM_DISASSEMBLER
138 #ifdef LLVM_NATIVE_TARGET
139 LLVM_NATIVE_TARGETINFO();
140 LLVM_NATIVE_TARGET();
141 LLVM_NATIVE_TARGETMC();
152 #ifdef LLVM_NATIVE_ASMPARSER
153 LLVM_NATIVE_ASMPARSER();
164 #ifdef LLVM_NATIVE_ASMPRINTER
165 LLVM_NATIVE_ASMPRINTER();
176 #ifdef LLVM_NATIVE_DISASSEMBLER
177 LLVM_NATIVE_DISASSEMBLER();
271 unsigned long long Offset);
enum LLVMByteOrdering LLVMByteOrder(LLVMTargetDataRef TD)
Returns the byte order of a target, either LLVMBigEndian or LLVMLittleEndian.
struct LLVMOpaqueType * LLVMTypeRef
Each value in the LLVM IR has a type, an LLVMTypeRef.
unsigned LLVMPreferredAlignmentOfGlobal(LLVMTargetDataRef TD, LLVMValueRef GlobalVar)
Computes the preferred alignment of a global variable in bytes for a target.
static void LLVMInitializeAllTargets(void)
LLVMInitializeAllTargets - The main program should call this function if it wants to link in all avai...
struct LLVMOpaqueTargetData * LLVMTargetDataRef
static void LLVMInitializeAllAsmParsers(void)
LLVMInitializeAllAsmParsers - The main program should call this function if it wants all asm parsers ...
LLVMTypeRef LLVMIntPtrType(LLVMTargetDataRef TD)
Returns the integer type that is the same size as a pointer on a target.
unsigned long long LLVMABISizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the ABI size of a type in bytes for a target.
static LLVMBool LLVMInitializeNativeAsmParser(void)
LLVMInitializeNativeTargetAsmParser - The main program should call this function to initialize the pa...
static void LLVMInitializeAllAsmPrinters(void)
LLVMInitializeAllAsmPrinters - The main program should call this function if it wants all asm printer...
static LLVMBool LLVMInitializeNativeAsmPrinter(void)
LLVMInitializeNativeTargetAsmPrinter - The main program should call this function to initialize the p...
static void LLVMInitializeAllDisassemblers(void)
LLVMInitializeAllDisassemblers - The main program should call this function if it wants all disassemb...
unsigned long long LLVMOffsetOfElement(LLVMTargetDataRef TD, LLVMTypeRef StructTy, unsigned Element)
Computes the byte offset of the indexed struct element for a target.
unsigned LLVMElementAtOffset(LLVMTargetDataRef TD, LLVMTypeRef StructTy, unsigned long long Offset)
Computes the structure element that contains the byte offset for a target.
unsigned long long LLVMSizeOfTypeInBits(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the size of a type in bytes for a target.
static void LLVMInitializeAllTargetMCs(void)
LLVMInitializeAllTargetMCs - The main program should call this function if it wants access to all ava...
unsigned LLVMPointerSizeForAS(LLVMTargetDataRef TD, unsigned AS)
Returns the pointer size in bytes for a target for a specified address space.
LLVMTypeRef LLVMIntPtrTypeForASInContext(LLVMContextRef C, LLVMTargetDataRef TD, unsigned AS)
Returns the integer type that is the same size as a pointer on a target.
void LLVMDisposeTargetData(LLVMTargetDataRef TD)
Deallocates a TargetData.
struct LLVMOpaqueContext * LLVMContextRef
The top-level container for all LLVM global data.
unsigned LLVMPreferredAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the preferred alignment of a type in bytes for a target.
unsigned long long LLVMStoreSizeOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the storage size of a type in bytes for a target.
struct LLVMOpaqueValue * LLVMValueRef
Represents an individual value in LLVM IR.
char * LLVMCopyStringRepOfTargetData(LLVMTargetDataRef TD)
Converts target data to a target layout string.
unsigned LLVMPointerSize(LLVMTargetDataRef TD)
Returns the pointer size in bytes for a target.
static LLVMBool LLVMInitializeNativeTarget(void)
LLVMInitializeNativeTarget - The main program should call this function to initialize the native targ...
struct LLVMOpaqueTargetLibraryInfotData * LLVMTargetLibraryInfoRef
LLVMTargetDataRef LLVMCreateTargetData(const char *StringRep)
Creates target data from a target layout string.
unsigned LLVMCallFrameAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the call frame alignment of a type in bytes for a target.
struct LLVMOpaquePassManager * LLVMPassManagerRef
LLVMTypeRef LLVMIntPtrTypeForAS(LLVMTargetDataRef TD, unsigned AS)
Returns the integer type that is the same size as a pointer on a target.
static void LLVMInitializeAllTargetInfos(void)
LLVMInitializeAllTargetInfos - The main program should call this function if it wants access to all a...
static LLVMBool LLVMInitializeNativeDisassembler(void)
LLVMInitializeNativeTargetDisassembler - The main program should call this function to initialize the...
void LLVMAddTargetData(LLVMTargetDataRef TD, LLVMPassManagerRef PM)
Adds target data information to a pass manager.
void LLVMAddTargetLibraryInfo(LLVMTargetLibraryInfoRef TLI, LLVMPassManagerRef PM)
Adds target library information to a pass manager.
unsigned LLVMABIAlignmentOfType(LLVMTargetDataRef TD, LLVMTypeRef Ty)
Computes the ABI alignment of a type in bytes for a target.
LLVMTypeRef LLVMIntPtrTypeInContext(LLVMContextRef C, LLVMTargetDataRef TD)
Returns the integer type that is the same size as a pointer on a target.
C - The default llvm calling convention, compatible with C.