mini-llvm
0.1.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Xor.h
Go to the documentation of this file.
1
// SPDX-License-Identifier: MIT
2
3
#pragma once
4
5
#include <memory>
6
#include <string>
7
#include <utility>
8
9
#include "
mini-llvm/ir/Constant.h
"
10
#include "
mini-llvm/ir/Instruction/BinaryIntegerArithmeticOperator.h
"
11
#include "
mini-llvm/ir/InstructionVisitor.h
"
12
#include "
mini-llvm/ir/Value.h
"
13
#include "
mini-llvm/utils/Compiler.h
"
14
15
namespace
mini_llvm::ir
{
16
17
class
MINI_LLVM_EXPORT
Xor
final :
public
BinaryIntegerArithmeticOperator
{
18
public
:
19
Xor
(std::shared_ptr<Value>
lhs
, std::shared_ptr<Value>
rhs
)
20
:
BinaryIntegerArithmeticOperator
(std::move(
lhs
), std::move(
rhs
)) {}
21
22
bool
isCommutative
()
const override
{
23
return
true
;
24
}
25
26
bool
isAssociative
()
const override
{
27
return
true
;
28
}
29
30
std::shared_ptr<Constant>
fold
()
const override
;
31
32
void
accept
(
InstructionVisitor
&visitor)
override
{
33
visitor.
visitXor
(*
this
);
34
}
35
36
void
accept
(
InstructionVisitor
&visitor)
const override
{
37
visitor.
visitXor
(*
this
);
38
}
39
40
std::string
format
()
const override
;
41
std::unique_ptr<Value>
clone
()
const override
;
42
};
43
44
}
// namespace mini_llvm::ir
BinaryIntegerArithmeticOperator.h
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
Value.h
mini_llvm::ir::BinaryIntegerArithmeticOperator::BinaryIntegerArithmeticOperator
BinaryIntegerArithmeticOperator(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition
BinaryIntegerArithmeticOperator.h:30
mini_llvm::ir::BinaryIntegerOperator::lhs
auto & lhs(this Self &&self)
Definition
BinaryIntegerOperator.h:19
mini_llvm::ir::BinaryIntegerOperator::rhs
auto & rhs(this Self &&self)
Definition
BinaryIntegerOperator.h:24
mini_llvm::ir::InstructionVisitor
Definition
InstructionVisitor.h:58
mini_llvm::ir::InstructionVisitor::visitXor
virtual void visitXor(Xor &I)
Definition
InstructionVisitor.h:113
mini_llvm::ir::Xor::accept
void accept(InstructionVisitor &visitor) override
Definition
Xor.h:32
mini_llvm::ir::Xor::Xor
Xor(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition
Xor.h:19
mini_llvm::ir::Xor::format
std::string format() const override
mini_llvm::ir::Xor::isCommutative
bool isCommutative() const override
Definition
Xor.h:22
mini_llvm::ir::Xor::fold
std::shared_ptr< Constant > fold() const override
mini_llvm::ir::Xor::isAssociative
bool isAssociative() const override
Definition
Xor.h:26
mini_llvm::ir::Xor::clone
std::unique_ptr< Value > clone() const override
mini_llvm::ir::Xor::accept
void accept(InstructionVisitor &visitor) const override
Definition
Xor.h:36
Constant.h
InstructionVisitor.h
mini_llvm::ir
Definition
Argument.h:13
include
mini-llvm
ir
Instruction
Xor.h
Generated by
1.17.0