mini-llvm 0.1.0
Loading...
Searching...
No Matches
UnaryFloatingOperator.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
10#include "mini-llvm/ir/Use.h"
11#include "mini-llvm/ir/Value.h"
13
14namespace mini_llvm::ir {
15
17public:
18 template <typename Self>
19 auto &value(this Self &&self) {
20 return self.value_;
21 }
22
23 std::unordered_set<const UseBase *> operands() const override {
24 return {&value()};
25 }
26
27 bool isFoldable() const override;
28 bool isWellFormed() const override;
29
30protected:
31 explicit UnaryFloatingOperator(std::shared_ptr<Value> value) : value_(this, std::move(value)) {}
32
33private:
34 Use<Value> value_;
35};
36
37} // namespace mini_llvm::ir
#define MINI_LLVM_EXPORT
Definition Compiler.h:17
Definition Instruction.h:22
std::unordered_set< const UseBase * > operands() const override
Definition UnaryFloatingOperator.h:23
UnaryFloatingOperator(std::shared_ptr< Value > value)
Definition UnaryFloatingOperator.h:31
bool isWellFormed() const override
bool isFoldable() const override
auto & value(this Self &&self)
Definition UnaryFloatingOperator.h:19
Definition Use.h:44
Definition Argument.h:13