mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
UnaryFloatingOperator.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/Use.h
"
11
#include "
mini-llvm/ir/Value.h
"
12
#include "
mini-llvm/utils/Compiler.h
"
13
14
namespace
mini_llvm::ir
{
15
16
class
MINI_LLVM_EXPORT
UnaryFloatingOperator
:
public
Instruction
{
17
public
:
18
template
<
typename
Self>
19
auto
&
value
(
this
Self &&self) {
20
return
self.value_;
21
}
22
23
std::unordered_set<const UseBase *>
operands
()
const override
{
24
return
{&
value
()};
25
}
26
27
bool
isFoldable
()
const override
;
28
bool
isWellFormed
()
const override
;
29
30
protected
:
31
explicit
UnaryFloatingOperator
(std::shared_ptr<Value>
value
) : value_(this, std::move(
value
)) {}
32
33
private
:
34
Use<Value>
value_;
35
};
36
37
}
// namespace mini_llvm::ir
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
Use.h
Value.h
mini_llvm::ir::Instruction
Definition
Instruction.h:22
mini_llvm::ir::UnaryFloatingOperator::operands
std::unordered_set< const UseBase * > operands() const override
Definition
UnaryFloatingOperator.h:23
mini_llvm::ir::UnaryFloatingOperator::UnaryFloatingOperator
UnaryFloatingOperator(std::shared_ptr< Value > value)
Definition
UnaryFloatingOperator.h:31
mini_llvm::ir::UnaryFloatingOperator::isWellFormed
bool isWellFormed() const override
mini_llvm::ir::UnaryFloatingOperator::isFoldable
bool isFoldable() const override
mini_llvm::ir::UnaryFloatingOperator::value
auto & value(this Self &&self)
Definition
UnaryFloatingOperator.h:19
mini_llvm::ir::Use
Definition
Use.h:44
Instruction.h
mini_llvm::ir
Definition
Argument.h:13
include
mini-llvm
ir
Instruction
UnaryFloatingOperator.h
Generated by
1.17.0