mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
I1.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <cstdint>
6
#include <cstdlib>
7
#include <memory>
8
#include <string>
9
#include <typeinfo>
10
11
#include "
mini-llvm/ir/Constant.h
"
12
#include "
mini-llvm/ir/Type.h
"
13
#include "
mini-llvm/ir/Type/IntegerType.h
"
14
#include "
mini-llvm/ir/TypeVisitor.h
"
15
#include "
mini-llvm/utils/Compiler.h
"
16
17
namespace
mini_llvm::ir
{
18
19
class
MINI_LLVM_EXPORT
I1
final :
public
IntegerType
{
20
public
:
21
int
size
()
const override
{
22
return
1;
23
}
24
25
int
alignment
()
const override
{
26
return
1;
27
}
28
29
int
bitSize
()
const override
{
30
return
1;
31
}
32
33
int
bitAlignment
()
const override
{
34
return
1;
35
}
36
37
std::unique_ptr<Constant>
zeroValue
()
const override
;
38
std::unique_ptr<Constant>
constant
(int64_t value)
const override
;
39
40
std::unique_ptr<Type>
promoted
()
const override
{
41
abort();
42
}
43
44
std::unique_ptr<Type>
demoted
()
const override
{
45
abort();
46
}
47
48
std::string
format
()
const override
{
49
return
"i1"
;
50
}
51
52
std::unique_ptr<Type>
clone
()
const override
{
53
return
std::make_unique<I1>();
54
}
55
56
void
accept
(
TypeVisitor
&visitor)
override
{
57
visitor.
visitI1
(*
this
);
58
}
59
60
void
accept
(
TypeVisitor
&visitor)
const override
{
61
visitor.
visitI1
(*
this
);
62
}
63
64
protected
:
65
bool
equals
(
const
Type
&other)
const override
{
66
return
typeid
(*this) ==
typeid
(other);
67
}
68
};
69
70
}
// namespace mini_llvm::ir
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
IntegerType.h
TypeVisitor.h
Type.h
mini_llvm::ir::I1
Definition
I1.h:19
mini_llvm::ir::I1::constant
std::unique_ptr< Constant > constant(int64_t value) const override
mini_llvm::ir::I1::demoted
std::unique_ptr< Type > demoted() const override
Definition
I1.h:44
mini_llvm::ir::I1::clone
std::unique_ptr< Type > clone() const override
Definition
I1.h:52
mini_llvm::ir::I1::alignment
int alignment() const override
Definition
I1.h:25
mini_llvm::ir::I1::format
std::string format() const override
Definition
I1.h:48
mini_llvm::ir::I1::accept
void accept(TypeVisitor &visitor) const override
Definition
I1.h:60
mini_llvm::ir::I1::equals
bool equals(const Type &other) const override
Definition
I1.h:65
mini_llvm::ir::I1::bitSize
int bitSize() const override
Definition
I1.h:29
mini_llvm::ir::I1::bitAlignment
int bitAlignment() const override
Definition
I1.h:33
mini_llvm::ir::I1::size
int size() const override
Definition
I1.h:21
mini_llvm::ir::I1::accept
void accept(TypeVisitor &visitor) override
Definition
I1.h:56
mini_llvm::ir::I1::promoted
std::unique_ptr< Type > promoted() const override
Definition
I1.h:40
mini_llvm::ir::I1::zeroValue
std::unique_ptr< Constant > zeroValue() const override
mini_llvm::ir::IntegerType
Definition
IntegerType.h:10
mini_llvm::ir::TypeVisitor
Definition
TypeVisitor.h:25
mini_llvm::ir::TypeVisitor::visitI1
virtual void visitI1(I1 &type)
Definition
TypeVisitor.h:42
mini_llvm::ir::Type
Definition
Type.h:18
Constant.h
mini_llvm::ir
Definition
Argument.h:13
include
mini-llvm
ir
Type
I1.h
Generated by
1.17.0