mini-llvm 0.1.0
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
12#include "mini-llvm/ir/Type.h"
16
17namespace mini_llvm::ir {
18
19class MINI_LLVM_EXPORT I64 final : public IntegerType {
20public:
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
54protected:
55 bool equals(const Type &other) const override {
56 return typeid(*this) == typeid(other);
57 }
58};
59
60} // namespace mini_llvm::ir
#define MINI_LLVM_EXPORT
Definition Compiler.h:17
Definition I64.h:19
int alignment() const override
Definition I64.h:25
std::unique_ptr< Type > promoted() const override
Definition I64.h:32
std::string format() const override
Definition I64.h:38
void accept(TypeVisitor &visitor) override
Definition I64.h:46
std::unique_ptr< Constant > constant(int64_t value) const override
std::unique_ptr< Type > clone() const override
Definition I64.h:42
bool equals(const Type &other) const override
Definition I64.h:55
std::unique_ptr< Type > demoted() const override
int size() const override
Definition I64.h:21
void accept(TypeVisitor &visitor) const override
Definition I64.h:50
std::unique_ptr< Constant > zeroValue() const override
Definition IntegerType.h:10
Definition TypeVisitor.h:25
virtual void visitI64(I64 &type)
Definition TypeVisitor.h:45
Definition Type.h:18
Definition Argument.h:13