mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
I64.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
I64
final :
public
IntegerType
{
20
public
:
21
int
size
()
const override
{
22
return
8;
23
}
24
25
int
alignment
()
const override
{
26
return
8;
27
}
28
29
std::unique_ptr<Constant>
zeroValue
()
const override
;
30
std::unique_ptr<Constant>
constant
(int64_t value)
const override
;
31
32
std::unique_ptr<Type>
promoted
()
const override
{
33
abort();
34
}
35
36
std::unique_ptr<Type>
demoted
()
const override
;
37
38
std::string
format
()
const override
{
39
return
"i64"
;
40
}
41
42
std::unique_ptr<Type>
clone
()
const override
{
43
return
std::make_unique<I64>();
44
}
45
46
void
accept
(
TypeVisitor
&visitor)
override
{
47
visitor.
visitI64
(*
this
);
48
}
49
50
void
accept
(
TypeVisitor
&visitor)
const override
{
51
visitor.
visitI64
(*
this
);
52
}
53
54
protected
:
55
bool
equals
(
const
Type
&other)
const override
{
56
return
typeid
(*this) ==
typeid
(other);
57
}
58
};
59
60
}
// 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::I64
Definition
I64.h:19
mini_llvm::ir::I64::alignment
int alignment() const override
Definition
I64.h:25
mini_llvm::ir::I64::promoted
std::unique_ptr< Type > promoted() const override
Definition
I64.h:32
mini_llvm::ir::I64::format
std::string format() const override
Definition
I64.h:38
mini_llvm::ir::I64::accept
void accept(TypeVisitor &visitor) override
Definition
I64.h:46
mini_llvm::ir::I64::constant
std::unique_ptr< Constant > constant(int64_t value) const override
mini_llvm::ir::I64::clone
std::unique_ptr< Type > clone() const override
Definition
I64.h:42
mini_llvm::ir::I64::equals
bool equals(const Type &other) const override
Definition
I64.h:55
mini_llvm::ir::I64::demoted
std::unique_ptr< Type > demoted() const override
mini_llvm::ir::I64::size
int size() const override
Definition
I64.h:21
mini_llvm::ir::I64::accept
void accept(TypeVisitor &visitor) const override
Definition
I64.h:50
mini_llvm::ir::I64::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::visitI64
virtual void visitI64(I64 &type)
Definition
TypeVisitor.h:45
mini_llvm::ir::Type
Definition
Type.h:18
Constant.h
mini_llvm::ir
Definition
Argument.h:13
include
mini-llvm
ir
Type
I64.h
Generated by
1.17.0