mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
BinaryIntegerArithmeticOperator.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/BinaryIntegerOperator.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
BinaryIntegerArithmeticOperator
:
public
BinaryIntegerOperator
{
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
// (x op y) op z == x op (y op z)
25
virtual
bool
isAssociative
()
const
= 0;
26
27
bool
isWellFormed
()
const override
;
28
29
protected
:
30
BinaryIntegerArithmeticOperator
(std::shared_ptr<Value>
lhs
, std::shared_ptr<Value>
rhs
)
31
:
BinaryIntegerOperator
(std::move(
lhs
), std::move(
rhs
)) {}
32
};
33
34
}
// namespace mini_llvm::ir
BinaryIntegerOperator.h
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
Type.h
Value.h
mini_llvm::ir::BinaryIntegerArithmeticOperator::isCommutative
virtual bool isCommutative() const =0
mini_llvm::ir::BinaryIntegerArithmeticOperator::type
std::unique_ptr< Type > type() const override
Definition
BinaryIntegerArithmeticOperator.h:17
mini_llvm::ir::BinaryIntegerArithmeticOperator::BinaryIntegerArithmeticOperator
BinaryIntegerArithmeticOperator(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition
BinaryIntegerArithmeticOperator.h:30
mini_llvm::ir::BinaryIntegerArithmeticOperator::isWellFormed
bool isWellFormed() const override
mini_llvm::ir::BinaryIntegerArithmeticOperator::isAssociative
virtual bool isAssociative() const =0
mini_llvm::ir::BinaryIntegerOperator::lhs
auto & lhs(this Self &&self)
Definition
BinaryIntegerOperator.h:19
mini_llvm::ir::BinaryIntegerOperator::BinaryIntegerOperator
BinaryIntegerOperator(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition
BinaryIntegerOperator.h:36
mini_llvm::ir::BinaryIntegerOperator::rhs
auto & rhs(this Self &&self)
Definition
BinaryIntegerOperator.h:24
mini_llvm::ir
Definition
Argument.h:13
include
mini-llvm
ir
Instruction
BinaryIntegerArithmeticOperator.h
Generated by
1.17.0