mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
BinaryFloatingArithmeticOperator.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <memory>
6
#include <utility>
7
8
#include "
mini-llvm/ir/Instruction/BinaryFloatingOperator.h
"
9
#include "
mini-llvm/ir/Type.h
"
10
#include "
mini-llvm/ir/Value.h
"
11
#include "
mini-llvm/utils/Compiler.h
"
12
13
namespace
mini_llvm::ir
{
14
15
class
MINI_LLVM_EXPORT
BinaryFloatingArithmeticOperator
:
public
BinaryFloatingOperator
{
16
public
:
17
std::unique_ptr<Type>
type
()
const override
{
18
return
lhs
()->type();
19
}
20
21
// x op y == y op x
22
virtual
bool
isCommutative
()
const
= 0;
23
24
protected
:
25
BinaryFloatingArithmeticOperator
(std::shared_ptr<Value>
lhs
, std::shared_ptr<Value>
rhs
)
26
:
BinaryFloatingOperator
(std::move(
lhs
), std::move(
rhs
)) {}
27
};
28
29
}
// namespace mini_llvm::ir
BinaryFloatingOperator.h
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
Type.h
Value.h
mini_llvm::ir::BinaryFloatingArithmeticOperator::BinaryFloatingArithmeticOperator
BinaryFloatingArithmeticOperator(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition
BinaryFloatingArithmeticOperator.h:25
mini_llvm::ir::BinaryFloatingArithmeticOperator::type
std::unique_ptr< Type > type() const override
Definition
BinaryFloatingArithmeticOperator.h:17
mini_llvm::ir::BinaryFloatingArithmeticOperator::isCommutative
virtual bool isCommutative() const =0
mini_llvm::ir::BinaryFloatingOperator::rhs
auto & rhs(this Self &&self)
Definition
BinaryFloatingOperator.h:24
mini_llvm::ir::BinaryFloatingOperator::lhs
auto & lhs(this Self &&self)
Definition
BinaryFloatingOperator.h:19
mini_llvm::ir::BinaryFloatingOperator::BinaryFloatingOperator
BinaryFloatingOperator(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition
BinaryFloatingOperator.h:36
mini_llvm::ir
Definition
Argument.h:13
include
mini-llvm
ir
Instruction
BinaryFloatingArithmeticOperator.h
Generated by
1.17.0