mini-llvm 0.1.0
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
9#include "mini-llvm/ir/Type.h"
10#include "mini-llvm/ir/Value.h"
12
13namespace mini_llvm::ir {
14
16public:
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
24protected:
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
#define MINI_LLVM_EXPORT
Definition Compiler.h:17
BinaryFloatingArithmeticOperator(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition BinaryFloatingArithmeticOperator.h:25
std::unique_ptr< Type > type() const override
Definition BinaryFloatingArithmeticOperator.h:17
auto & rhs(this Self &&self)
Definition BinaryFloatingOperator.h:24
auto & lhs(this Self &&self)
Definition BinaryFloatingOperator.h:19
BinaryFloatingOperator(std::shared_ptr< Value > lhs, std::shared_ptr< Value > rhs)
Definition BinaryFloatingOperator.h:36
Definition Argument.h:13