Jlm
Loading...
Searching...
No Matches
delta.hpp
Go to the documentation of this file.
1/*
2 * Copyright 2017 Nico Reißmann <nico.reissmann@gmail.com>
3 * See COPYING for terms of redistribution.
4 */
5
6#ifndef JLM_LLVM_IR_OPERATORS_DELTA_HPP
7#define JLM_LLVM_IR_OPERATORS_DELTA_HPP
8
11#include <jlm/rvsdg/delta.hpp>
13
14namespace jlm::llvm
15{
16
20{
21public:
22 ~LlvmDeltaOperation() noexcept override;
23
25 const std::shared_ptr<const rvsdg::Type> & type,
26 const std::string & name,
27 const Linkage & linkage,
28 std::string section,
29 const bool constant,
30 const size_t alignment)
32 name_(name),
33 Section_(std::move(section)),
35 alignment_(alignment)
36 {}
37
38 LlvmDeltaOperation(const LlvmDeltaOperation & other) = default;
39
40 LlvmDeltaOperation(LlvmDeltaOperation && other) noexcept = default;
41
43 operator=(const LlvmDeltaOperation &) = delete;
44
47
48 [[nodiscard]] std::string
49 debug_string() const override;
50
51 [[nodiscard]] std::unique_ptr<Operation>
52 copy() const override;
53
54 [[nodiscard]] bool
55 operator==(const Operation & other) const noexcept override;
56
57 const std::string &
58 name() const noexcept
59 {
60 return name_;
61 }
62
63 [[nodiscard]] const std::string &
64 Section() const noexcept
65 {
66 return Section_;
67 }
68
69 const llvm::Linkage &
70 linkage() const noexcept
71 {
72 return linkage_;
73 }
74
75 [[nodiscard]] size_t
76 getAlignment() const noexcept
77 {
78 return alignment_;
79 }
80
81 static std::unique_ptr<LlvmDeltaOperation>
83 std::shared_ptr<const rvsdg::Type> type,
84 const std::string & name,
85 const Linkage & linkage,
86 std::string section,
87 bool constant,
88 const size_t alignment)
89 {
90 return std::make_unique<LlvmDeltaOperation>(
91 std::move(type),
92 name,
93 linkage,
94 std::move(section),
96 alignment);
97 }
98
99private:
100 std::string name_;
101 std::string Section_;
104};
105
106}
107
108#endif
static std::unique_ptr< LlvmDeltaOperation > Create(std::shared_ptr< const rvsdg::Type > type, const std::string &name, const Linkage &linkage, std::string section, bool constant, const size_t alignment)
Definition delta.hpp:82
const std::string & name() const noexcept
Definition delta.hpp:58
std::string debug_string() const override
Definition delta.cpp:15
LlvmDeltaOperation(const LlvmDeltaOperation &other)=default
const llvm::Linkage & linkage() const noexcept
Definition delta.hpp:70
bool operator==(const Operation &other) const noexcept override
Definition delta.cpp:27
~LlvmDeltaOperation() noexcept override
const std::string & Section() const noexcept
Definition delta.hpp:64
LlvmDeltaOperation & operator=(LlvmDeltaOperation &&)=delete
LlvmDeltaOperation(LlvmDeltaOperation &&other) noexcept=default
std::unique_ptr< Operation > copy() const override
Definition delta.cpp:21
LlvmDeltaOperation & operator=(const LlvmDeltaOperation &)=delete
size_t getAlignment() const noexcept
Definition delta.hpp:76
PointerType class.
Definition types.hpp:25
Delta operation.
Definition delta.hpp:18
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
Definition delta.hpp:63
const rvsdg::Type & type() const noexcept
Definition delta.hpp:57
DeltaOperation(std::shared_ptr< const rvsdg::Type > type, bool constant, std::shared_ptr< const rvsdg::Type > reftype)
Definition delta.hpp:22
bool constant() const noexcept
Definition delta.hpp:51
Global memory state passed between functions.