LLVM
10.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
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// This file defines C bindings wrappers for enums in llvm/Support/CodeGen.h
10
// that need them. The wrappers are separated to avoid adding an indirect
11
// dependency on llvm/Config/Targets.def to CodeGen.h.
12
//
13
//===----------------------------------------------------------------------===//
14
15
#ifndef LLVM_TARGET_CODEGENCWRAPPERS_H
16
#define LLVM_TARGET_CODEGENCWRAPPERS_H
17
18
#include "
llvm-c/TargetMachine.h
"
19
#include "
llvm/ADT/Optional.h
"
20
#include "
llvm/Support/CodeGen.h
"
21
#include "
llvm/Support/ErrorHandling.h
"
22
23
namespace
llvm
{
24
25
inline
Optional<CodeModel::Model>
unwrap
(
LLVMCodeModel
Model
,
bool
&
JIT
) {
26
JIT =
false
;
27
switch
(Model) {
28
case
LLVMCodeModelJITDefault
:
29
JIT =
true
;
30
LLVM_FALLTHROUGH
;
31
case
LLVMCodeModelDefault
:
32
return
None
;
33
case
LLVMCodeModelTiny
:
34
return
CodeModel::Tiny
;
35
case
LLVMCodeModelSmall
:
36
return
CodeModel::Small
;
37
case
LLVMCodeModelKernel
:
38
return
CodeModel::Kernel
;
39
case
LLVMCodeModelMedium
:
40
return
CodeModel::Medium
;
41
case
LLVMCodeModelLarge
:
42
return
CodeModel::Large
;
43
}
44
return
CodeModel::Small
;
45
}
46
47
inline
LLVMCodeModel
wrap
(
CodeModel::Model
Model
) {
48
switch
(Model) {
49
case
CodeModel::Tiny
:
50
return
LLVMCodeModelTiny
;
51
case
CodeModel::Small
:
52
return
LLVMCodeModelSmall
;
53
case
CodeModel::Kernel
:
54
return
LLVMCodeModelKernel
;
55
case
CodeModel::Medium
:
56
return
LLVMCodeModelMedium
;
57
case
CodeModel::Large
:
58
return
LLVMCodeModelLarge
;
59
}
60
llvm_unreachable
(
"Bad CodeModel!"
);
61
}
62
}
// namespace llvm
63
64
#endif
llvm::None
const NoneType None
Definition:
None.h:23
llvm::CodeModel::Model
Model
Definition:
CodeGen.h:28
LLVMCodeModelMedium
Definition:
TargetMachine.h:54
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:23
llvm::CodeModel::Small
Definition:
CodeGen.h:28
llvm::Reloc::Model
Model
Definition:
CodeGen.h:22
LLVMCodeModelKernel
Definition:
TargetMachine.h:53
llvm::Optional< CodeModel::Model >
llvm::unwrap
Attribute unwrap(LLVMAttributeRef Attr)
Definition:
Attributes.h:204
TargetMachine.h
llvm::CodeModel::Medium
Definition:
CodeGen.h:28
CodeGen.h
llvm::EngineKind::JIT
Definition:
ExecutionEngine.h:516
LLVMCodeModel
LLVMCodeModel
Definition:
TargetMachine.h:48
llvm::CodeModel::Tiny
Definition:
CodeGen.h:28
LLVMCodeModelJITDefault
Definition:
TargetMachine.h:50
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:135
ErrorHandling.h
llvm::wrap
LLVMAttributeRef wrap(Attribute Attr)
Definition:
Attributes.h:199
LLVMCodeModelDefault
Definition:
TargetMachine.h:49
LLVMCodeModelSmall
Definition:
TargetMachine.h:52
LLVMCodeModelTiny
Definition:
TargetMachine.h:51
LLVM_FALLTHROUGH
#define LLVM_FALLTHROUGH
LLVM_FALLTHROUGH - Mark fallthrough cases in switch statements.
Definition:
Compiler.h:279
LLVMCodeModelLarge
Definition:
TargetMachine.h:55
Optional.h
llvm::CodeModel::Large
Definition:
CodeGen.h:28
Generated on Tue Mar 24 2020 13:08:32 for LLVM by
1.8.13