LLVM
7.0.0
include
llvm
Target
CodeGenCWrappers.h
Go to the documentation of this file.
1
//===- llvm/Target/CodeGenCWrappers.h - CodeGen C Wrappers ------*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// This file defines C bindings wrappers for enums in llvm/Support/CodeGen.h
11
// that need them. The wrappers are separated to avoid adding an indirect
12
// dependency on llvm/Config/Targets.def to CodeGen.h.
13
//
14
//===----------------------------------------------------------------------===//
15
16
#ifndef LLVM_TARGET_CODEGENCWRAPPERS_H
17
#define LLVM_TARGET_CODEGENCWRAPPERS_H
18
19
#include "
llvm-c/TargetMachine.h
"
20
#include "
llvm/ADT/Optional.h
"
21
#include "
llvm/Support/CodeGen.h
"
22
#include "
llvm/Support/ErrorHandling.h
"
23
24
namespace
llvm
{
25
26
inline
Optional<CodeModel::Model>
unwrap
(
LLVMCodeModel
Model
,
bool
&
JIT
) {
27
JIT =
false
;
28
switch
(Model) {
29
case
LLVMCodeModelJITDefault
:
30
JIT =
true
;
31
LLVM_FALLTHROUGH
;
32
case
LLVMCodeModelDefault
:
33
return
None
;
34
case
LLVMCodeModelSmall
:
35
return
CodeModel::Small
;
36
case
LLVMCodeModelKernel
:
37
return
CodeModel::Kernel
;
38
case
LLVMCodeModelMedium
:
39
return
CodeModel::Medium
;
40
case
LLVMCodeModelLarge
:
41
return
CodeModel::Large
;
42
}
43
return
CodeModel::Small
;
44
}
45
46
inline
LLVMCodeModel
wrap
(
CodeModel::Model
Model
) {
47
switch
(Model) {
48
case
CodeModel::Small
:
49
return
LLVMCodeModelSmall
;
50
case
CodeModel::Kernel
:
51
return
LLVMCodeModelKernel
;
52
case
CodeModel::Medium
:
53
return
LLVMCodeModelMedium
;
54
case
CodeModel::Large
:
55
return
LLVMCodeModelLarge
;
56
}
57
llvm_unreachable
(
"Bad CodeModel!"
);
58
}
59
}
// namespace llvm
60
61
#endif
llvm::None
const NoneType None
Definition:
None.h:24
llvm::CodeModel::Model
Model
Definition:
CodeGen.h:28
LLVMCodeModelMedium
Definition:
TargetMachine.h:50
llvm
Compute iterated dominance frontiers using a linear time algorithm.
Definition:
AllocatorList.h:24
llvm::CodeModel::Small
Definition:
CodeGen.h:28
llvm::Reloc::Model
Model
Definition:
CodeGen.h:22
LLVMCodeModelKernel
Definition:
TargetMachine.h:49
llvm::Optional< CodeModel::Model >
llvm::unwrap
Attribute unwrap(LLVMAttributeRef Attr)
Definition:
Attributes.h:195
TargetMachine.h
llvm::CodeModel::Medium
Definition:
CodeGen.h:28
CodeGen.h
llvm::EngineKind::JIT
Definition:
ExecutionEngine.h:516
LLVMCodeModel
LLVMCodeModel
Definition:
TargetMachine.h:45
LLVMCodeModelJITDefault
Definition:
TargetMachine.h:47
llvm::CodeModel::Kernel
Definition:
CodeGen.h:28
llvm_unreachable
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Definition:
ErrorHandling.h:136
ErrorHandling.h
llvm::wrap
LLVMAttributeRef wrap(Attribute Attr)
Definition:
Attributes.h:190
LLVMCodeModelDefault
Definition:
TargetMachine.h:46
LLVMCodeModelSmall
Definition:
TargetMachine.h:48
LLVM_FALLTHROUGH
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition:
Compiler.h:238
LLVMCodeModelLarge
Definition:
TargetMachine.h:51
Optional.h
llvm::CodeModel::Large
Definition:
CodeGen.h:28
Generated on Thu Aug 23 2018 18:52:42 for LLVM by
1.8.13