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  std::shared_ptr<const rvsdg::Type> type,
28  const std::string & name,
29  const llvm::Linkage & linkage,
30  std::string section,
31  bool constant)
33  name_(name),
34  Section_(std::move(section)),
36  {}
37 
38  DeltaOperation(const DeltaOperation & other) = default;
39 
40  DeltaOperation(DeltaOperation && other) noexcept = default;
41 
43  operator=(const DeltaOperation &) = delete;
44 
46  operator=(DeltaOperation &&) = delete;
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  static inline std::unique_ptr<DeltaOperation>
77  std::shared_ptr<const rvsdg::Type> type,
78  const std::string & name,
79  const llvm::Linkage & linkage,
80  std::string section,
81  bool constant)
82  {
83  return std::make_unique<DeltaOperation>(
84  std::move(type),
85  name,
86  linkage,
87  std::move(section),
88  constant);
89  }
90 
91 private:
92  std::string name_;
93  std::string Section_;
95 };
96 
97 }
98 
99 #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:64
const std::string & name() const noexcept
Definition: delta.hpp:58
static std::unique_ptr< DeltaOperation > Create(std::shared_ptr< const rvsdg::Type > type, const std::string &name, const llvm::Linkage &linkage, std::string section, bool constant)
Definition: delta.hpp:76
llvm::Linkage linkage_
Definition: delta.hpp:94
DeltaOperation & operator=(const DeltaOperation &)=delete
std::string Section_
Definition: delta.hpp:93
~DeltaOperation() noexcept override
DeltaOperation(DeltaOperation &&other) noexcept=default
DeltaOperation & operator=(DeltaOperation &&)=delete
const llvm::Linkage & linkage() const noexcept
Definition: delta.hpp:70
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.