Project Alice
Loading...
Searching...
No Matches
TargetMachine.h
Go to the documentation of this file.
1/*===-- llvm-c/TargetMachine.h - Target Machine Library C Interface - C++ -*-=*\
2|* *|
3|* Part of the LLVM Project, under the Apache License v2.0 with LLVM *|
4|* Exceptions. *|
5|* See https://llvm.org/LICENSE.txt for license information. *|
6|* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception *|
7|* *|
8|*===----------------------------------------------------------------------===*|
9|* *|
10|* This header declares the C interface to the Target and TargetMachine *|
11|* classes, which can be used to generate assembly or object files. *|
12|* *|
13|* Many exotic languages can interoperate with C code but have a harder time *|
14|* with C++ due to name mangling. So in addition to C, this interface enables *|
15|* tools written in such languages. *|
16|* *|
17\*===----------------------------------------------------------------------===*/
18
19#ifndef LLVM_C_TARGETMACHINE_H
20#define LLVM_C_TARGETMACHINE_H
21
22#include "llvm-c/ExternC.h"
23#include "llvm-c/Target.h"
24#include "llvm-c/Types.h"
25
27
34typedef struct LLVMOpaqueTargetMachineOptions *LLVMTargetMachineOptionsRef;
35typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef;
36typedef struct LLVMTarget *LLVMTargetRef;
37
38typedef enum {
44
45typedef enum {
54
55typedef enum {
64
65typedef enum {
69
70typedef enum {
75
80
81/*===-- Target ------------------------------------------------------------===*/
85
90 char **ErrorMessage);
91
94
97
100
103
106
107/*===-- Target Machine ----------------------------------------------------===*/
116
121
123 const char *CPU);
124
131 const char *Features);
132
134 const char *ABI);
135
138
140 LLVMRelocMode Reloc);
141
143 LLVMCodeModel CodeModel);
144
156
159 const char *Triple, const char *CPU, const char *Features,
160 LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc, LLVMCodeModel CodeModel);
161
165
168
173
178
183
186
189 LLVMBool VerboseAsm);
190
193
196
201
204 LLVMBool Enable);
205
210 const char *Filename,
211 LLVMCodeGenFileType codegen,
212 char **ErrorMessage);
213
216 LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf);
217
218/*===-- Triple ------------------------------------------------------------===*/
222
225char* LLVMNormalizeTargetTriple(const char* triple);
226
230
234
237
243
244#endif
#define LLVM_C_EXTERN_C_BEGIN
Definition: ExternC.h:35
#define LLVM_C_EXTERN_C_END
Definition: ExternC.h:36
int LLVMBool
Definition: Types.h:28
struct LLVMOpaquePassManager * LLVMPassManagerRef
Definition: Types.h:127
struct LLVMOpaqueMemoryBuffer * LLVMMemoryBufferRef
Definition: Types.h:48
struct LLVMOpaqueModule * LLVMModuleRef
Definition: Types.h:61
LLVMCodeGenFileType
Definition: TargetMachine.h:65
void LLVMTargetMachineOptionsSetCPU(LLVMTargetMachineOptionsRef Options, const char *CPU)
void LLVMTargetMachineOptionsSetFeatures(LLVMTargetMachineOptionsRef Options, const char *Features)
void LLVMSetTargetMachineMachineOutliner(LLVMTargetMachineRef T, LLVMBool Enable)
char * LLVMGetHostCPUFeatures(void)
void LLVMTargetMachineOptionsSetRelocMode(LLVMTargetMachineOptionsRef Options, LLVMRelocMode Reloc)
LLVMTargetRef LLVMGetFirstTarget(void)
struct LLVMTarget * LLVMTargetRef
Definition: TargetMachine.h:36
char * LLVMGetHostCPUName(void)
struct LLVMOpaqueTargetMachine * LLVMTargetMachineRef
Definition: TargetMachine.h:35
LLVMCodeModel
Definition: TargetMachine.h:55
void LLVMTargetMachineOptionsSetCodeGenOptLevel(LLVMTargetMachineOptionsRef Options, LLVMCodeGenOptLevel Level)
char * LLVMGetTargetMachineCPU(LLVMTargetMachineRef T)
void LLVMDisposeTargetMachineOptions(LLVMTargetMachineOptionsRef Options)
const char * LLVMGetTargetName(LLVMTargetRef T)
struct LLVMOpaqueTargetMachineOptions * LLVMTargetMachineOptionsRef
Definition: TargetMachine.h:34
void LLVMSetTargetMachineGlobalISel(LLVMTargetMachineRef T, LLVMBool Enable)
void LLVMAddAnalysisPasses(LLVMTargetMachineRef T, LLVMPassManagerRef PM)
LLVMTargetRef LLVMGetTargetFromName(const char *Name)
void LLVMSetTargetMachineFastISel(LLVMTargetMachineRef T, LLVMBool Enable)
const char * LLVMGetTargetDescription(LLVMTargetRef T)
char * LLVMGetDefaultTargetTriple(void)
void LLVMSetTargetMachineAsmVerbosity(LLVMTargetMachineRef T, LLVMBool VerboseAsm)
LLVMTargetMachineOptionsRef LLVMCreateTargetMachineOptions(void)
LLVMBool LLVMGetTargetFromTriple(const char *Triple, LLVMTargetRef *T, char **ErrorMessage)
char * LLVMNormalizeTargetTriple(const char *triple)
LLVMBool LLVMTargetHasAsmBackend(LLVMTargetRef T)
LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, const char *Filename, LLVMCodeGenFileType codegen, char **ErrorMessage)
char * LLVMGetTargetMachineTriple(LLVMTargetMachineRef T)
LLVMTargetMachineRef LLVMCreateTargetMachine(LLVMTargetRef T, const char *Triple, const char *CPU, const char *Features, LLVMCodeGenOptLevel Level, LLVMRelocMode Reloc, LLVMCodeModel CodeModel)
void LLVMTargetMachineOptionsSetABI(LLVMTargetMachineOptionsRef Options, const char *ABI)
LLVMTargetRef LLVMGetNextTarget(LLVMTargetRef T)
LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M, LLVMCodeGenFileType codegen, char **ErrorMessage, LLVMMemoryBufferRef *OutMemBuf)
LLVMTargetDataRef LLVMCreateTargetDataLayout(LLVMTargetMachineRef T)
LLVMBool LLVMTargetHasTargetMachine(LLVMTargetRef T)
LLVMRelocMode
Definition: TargetMachine.h:45
LLVMCodeGenOptLevel
Definition: TargetMachine.h:38
struct LLVMOpaqueTargetData * LLVMTargetDataRef
Definition: Target.h:37
LLVMTargetMachineRef LLVMCreateTargetMachineWithOptions(LLVMTargetRef T, const char *Triple, LLVMTargetMachineOptionsRef Options)
LLVMTargetRef LLVMGetTargetMachineTarget(LLVMTargetMachineRef T)
LLVMGlobalISelAbortMode
Definition: TargetMachine.h:70
void LLVMTargetMachineOptionsSetCodeModel(LLVMTargetMachineOptionsRef Options, LLVMCodeModel CodeModel)
void LLVMSetTargetMachineGlobalISelAbort(LLVMTargetMachineRef T, LLVMGlobalISelAbortMode Mode)
void LLVMDisposeTargetMachine(LLVMTargetMachineRef T)
LLVMBool LLVMTargetHasJIT(LLVMTargetRef T)
char * LLVMGetTargetMachineFeatureString(LLVMTargetMachineRef T)
@ LLVMAssemblyFile
Definition: TargetMachine.h:66
@ LLVMObjectFile
Definition: TargetMachine.h:67
@ LLVMCodeModelKernel
Definition: TargetMachine.h:60
@ LLVMCodeModelTiny
Definition: TargetMachine.h:58
@ LLVMCodeModelSmall
Definition: TargetMachine.h:59
@ LLVMCodeModelMedium
Definition: TargetMachine.h:61
@ LLVMCodeModelJITDefault
Definition: TargetMachine.h:57
@ LLVMCodeModelDefault
Definition: TargetMachine.h:56
@ LLVMCodeModelLarge
Definition: TargetMachine.h:62
@ LLVMRelocPIC
Definition: TargetMachine.h:48
@ LLVMRelocDynamicNoPic
Definition: TargetMachine.h:49
@ LLVMRelocStatic
Definition: TargetMachine.h:47
@ LLVMRelocRWPI
Definition: TargetMachine.h:51
@ LLVMRelocROPI
Definition: TargetMachine.h:50
@ LLVMRelocROPI_RWPI
Definition: TargetMachine.h:52
@ LLVMRelocDefault
Definition: TargetMachine.h:46
@ LLVMCodeGenLevelAggressive
Definition: TargetMachine.h:42
@ LLVMCodeGenLevelDefault
Definition: TargetMachine.h:41
@ LLVMCodeGenLevelNone
Definition: TargetMachine.h:39
@ LLVMCodeGenLevelLess
Definition: TargetMachine.h:40
@ LLVMGlobalISelAbortDisableWithDiag
Definition: TargetMachine.h:73
@ LLVMGlobalISelAbortDisable
Definition: TargetMachine.h:72
@ LLVMGlobalISelAbortEnable
Definition: TargetMachine.h:71