mini-llvm 0.1.0
Loading...
Searching...
No Matches
ASHR.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
11#include "mini-llvm/ir/Value.h"
13
14namespace mini_llvm::ir {
15
17public:
18 ASHR(std::shared_ptr<Value> lhs, std::shared_ptr<Value> rhs)
19 : BinaryIntegerArithmeticOperator(std::move(lhs), std::move(rhs)) {}
20
21 bool isCommutative() const override {
22 return false;
23 }
24
25 bool isAssociative() const override {
26 return false;
27 }
28
29 std::shared_ptr<Constant> fold() const override;
30
31 void accept(InstructionVisitor &visitor) override {
32 visitor.visitASHR(*this);
33 }
34
35 void accept(InstructionVisitor &visitor) const override {
36 visitor.visitASHR(*this);
37 }
38
39 std::string format() const override;
40 std::unique_ptr<Value> clone() const override;
41};
42
43} // namespace mini_llvm::ir
#define MINI_LLVM_EXPORT
Definition Compiler.h:17
std::string format() const override
ASHR(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition ASHR.h:18
std::shared_ptr< Constant > fold() const override
bool isCommutative() const override
Definition ASHR.h:21
std::unique_ptr< Value > clone() const override
bool isAssociative() const override
Definition ASHR.h:25
void accept(InstructionVisitor &visitor) const override
Definition ASHR.h:35
void accept(InstructionVisitor &visitor) override
Definition ASHR.h:31
BinaryIntegerArithmeticOperator(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition BinaryIntegerArithmeticOperator.h:30
auto & lhs(this Self &&self)
Definition BinaryIntegerOperator.h:19
auto & rhs(this Self &&self)
Definition BinaryIntegerOperator.h:24
Definition InstructionVisitor.h:58
virtual void visitASHR(ASHR &I)
Definition InstructionVisitor.h:73
Definition Argument.h:13