mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
BinaryIntegerOperator.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
BinaryIntegerOperator
:
public
Instruction
{
17
public
:
18
template
<
typename
Self>
19
auto
&
lhs
(
this
Self &&self) {
20
return
self.lhs_;
21
}
22
23
template
<
typename
Self>
24
auto
&
rhs
(
this
Self &&self) {
25
return
self.rhs_;
26
}
27
28
std::unordered_set<const UseBase *>
operands
()
const override
{
29
return
{&
lhs
(), &
rhs
()};
30
}
31
32
bool
isFoldable
()
const override
;
33
bool
isWellFormed
()
const override
;
34
35
protected
:
36
BinaryIntegerOperator
(std::shared_ptr<Value>
lhs
, std::shared_ptr<Value>
rhs
)
37
: lhs_(this, std::move(
lhs
)), rhs_(this, std::move(
rhs
)) {}
38
39
private
:
40
Use<Value>
lhs_, rhs_;
41
};
42
43
}
// namespace mini_llvm::ir
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
Use.h
Value.h
mini_llvm::ir::BinaryIntegerOperator::lhs
auto & lhs(this Self &&self)
Definition
BinaryIntegerOperator.h:19
mini_llvm::ir::BinaryIntegerOperator::isFoldable
bool isFoldable() const override
mini_llvm::ir::BinaryIntegerOperator::isWellFormed
bool isWellFormed() const override
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::BinaryIntegerOperator::operands
std::unordered_set< const UseBase * > operands() const override
Definition
BinaryIntegerOperator.h:28
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
BinaryIntegerOperator.h
Generated by
1.17.0