Jlm
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 
9 #include <jlm/llvm/ir/types.hpp>
10 #include <jlm/llvm/ir/variable.hpp>
11 #include <jlm/rvsdg/delta.hpp>
12 #include <jlm/rvsdg/region.hpp>
15 
16 namespace jlm::llvm
17 {
18 
22 {
23 public:
24  ~DeltaOperation() noexcept override;
25 
27  const std::shared_ptr<const rvsdg::Type> & type,
28  const std::string & name,
29  const Linkage & linkage,
30  std::string section,
31  const bool constant,
32  const size_t alignment)
34  name_(name),
35  Section_(std::move(section)),
37  alignment_(alignment)
38  {}
39 
40  DeltaOperation(const DeltaOperation & other) = default;
41 
42  DeltaOperation(DeltaOperation && other) noexcept = default;
43 
45  operator=(const DeltaOperation &) = delete;
46 
48  operator=(DeltaOperation &&) = delete;
49 
50  [[nodiscard]] std::string
51  debug_string() const override;
52 
53  [[nodiscard]] std::unique_ptr<Operation>
54  copy() const override;
55 
56  [[nodiscard]] bool
57  operator==(const Operation & other) const noexcept override;
58 
59  const std::string &
60  name() const noexcept
61  {
62  return name_;
63  }
64 
65  [[nodiscard]] const std::string &
66  Section() const noexcept
67  {
68  return Section_;
69  }
70 
71  const llvm::Linkage &
72  linkage() const noexcept
73  {
74  return linkage_;
75  }
76 
77  [[nodiscard]] size_t
78  getAlignment() const noexcept
79  {
80  return alignment_;
81  }
82 
83  static std::unique_ptr<DeltaOperation>
85  std::shared_ptr<const rvsdg::Type> type,
86  const std::string & name,
87  const Linkage & linkage,
88  std::string section,
89  bool constant,
90  const size_t alignment)
91  {
92  return std::make_unique<DeltaOperation>(
93  std::move(type),
94  name,
95  linkage,
96  std::move(section),
97  constant,
98  alignment);
99  }
100 
101 private:
102  std::string name_;
103  std::string Section_;
105  size_t alignment_;
106 };
107 
108 }
109 
110 #endif
Delta operation.
Definition: delta.hpp:22
bool operator==(const Operation &other) const noexcept override
Definition: delta.cpp:27
std::string debug_string() const override
Definition: delta.cpp:15
std::unique_ptr< Operation > copy() const override
Definition: delta.cpp:21
const std::string & Section() const noexcept
Definition: delta.hpp:66
static std::unique_ptr< DeltaOperation > 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:84
const std::string & name() const noexcept
Definition: delta.hpp:60
DeltaOperation & operator=(const DeltaOperation &)=delete
std::string Section_
Definition: delta.hpp:103
~DeltaOperation() noexcept override
DeltaOperation(DeltaOperation &&other) noexcept=default
size_t getAlignment() const noexcept
Definition: delta.hpp:78
DeltaOperation & operator=(DeltaOperation &&)=delete
const llvm::Linkage & linkage() const noexcept
Definition: delta.hpp:72
DeltaOperation(const DeltaOperation &other)=default
PointerType class.
Definition: types.hpp:25
Delta operation.
Definition: delta.hpp:18
const rvsdg::Type & type() const noexcept
Definition: delta.hpp:57
bool constant() const noexcept
Definition: delta.hpp:51
const std::shared_ptr< const rvsdg::Type > & Type() const noexcept
Definition: delta.hpp:63
Global memory state passed between functions.