mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
FloatingToIntegerCastingOperator.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <memory>
6
#include <unordered_set>
7
#include <utility>
8
9
#include "
mini-llvm/ir/Instruction.h
"
10
#include "
mini-llvm/ir/Type.h
"
11
#include "
mini-llvm/ir/Type/IntegerType.h
"
12
#include "
mini-llvm/ir/Use.h
"
13
#include "
mini-llvm/ir/Value.h
"
14
#include "
mini-llvm/utils/Compiler.h
"
15
16
namespace
mini_llvm::ir
{
17
18
class
MINI_LLVM_EXPORT
FloatingToIntegerCastingOperator
:
public
Instruction
{
19
public
:
20
template
<
typename
Self>
21
auto
&
value
(
this
Self &&self) {
22
return
self.value_;
23
}
24
25
std::unique_ptr<Type>
type
()
const override
{
26
return
type_->clone();
27
}
28
29
std::unordered_set<const UseBase *>
operands
()
const override
{
30
return
{&
value
()};
31
}
32
33
bool
isFoldable
()
const override
;
34
bool
isWellFormed
()
const override
;
35
36
protected
:
37
FloatingToIntegerCastingOperator
(std::shared_ptr<Value>
value
, std::unique_ptr<IntegerType>
type
)
38
: value_(this, std::move(
value
)), type_(std::move(
type
)) {}
39
40
private
:
41
Use<Value>
value_;
42
std::unique_ptr<IntegerType> type_;
43
};
44
45
}
// namespace mini_llvm::ir
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
IntegerType.h
Type.h
Use.h
Value.h
mini_llvm::ir::FloatingToIntegerCastingOperator::operands
std::unordered_set< const UseBase * > operands() const override
Definition
FloatingToIntegerCastingOperator.h:29
mini_llvm::ir::FloatingToIntegerCastingOperator::FloatingToIntegerCastingOperator
FloatingToIntegerCastingOperator(std::shared_ptr< Value > value, std::unique_ptr< IntegerType > type)
Definition
FloatingToIntegerCastingOperator.h:37
mini_llvm::ir::FloatingToIntegerCastingOperator::type
std::unique_ptr< Type > type() const override
Definition
FloatingToIntegerCastingOperator.h:25
mini_llvm::ir::FloatingToIntegerCastingOperator::isFoldable
bool isFoldable() const override
mini_llvm::ir::FloatingToIntegerCastingOperator::isWellFormed
bool isWellFormed() const override
mini_llvm::ir::FloatingToIntegerCastingOperator::value
auto & value(this Self &&self)
Definition
FloatingToIntegerCastingOperator.h:21
mini_llvm::ir::Instruction
Definition
Instruction.h:22
mini_llvm::ir::Use
Definition
Use.h:44
Instruction.h
mini_llvm::ir
Definition
Argument.h:13
include
mini-llvm
ir
Instruction
FloatingToIntegerCastingOperator.h
Generated by
1.17.0