Jlm
GetElementPtr.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2018 Nico Reißmann <nico.reissmann@gmail.com>
3  * See COPYING for terms of redistribution.
4  */
5 
7 
8 namespace jlm::llvm
9 {
10 
12 
13 bool
14 GetElementPtrOperation::operator==(const Operation & other) const noexcept
15 {
16  auto operation = dynamic_cast<const GetElementPtrOperation *>(&other);
17 
18  if (operation == nullptr || GetPointeeType() != operation->GetPointeeType()
19  || narguments() != operation->narguments())
20  {
21  return false;
22  }
23 
24  for (size_t n = 0; n < narguments(); n++)
25  {
26  if (operation->argument(n) != argument(n))
27  {
28  return false;
29  }
30  }
31 
32  return true;
33 }
34 
35 std::string
37 {
38  return "GetElementPtr";
39 }
40 
41 std::unique_ptr<rvsdg::Operation>
43 {
44  return std::make_unique<GetElementPtrOperation>(*this);
45 }
46 
47 }
std::string debug_string() const override
~GetElementPtrOperation() noexcept override
std::unique_ptr< Operation > copy() const override
Global memory state passed between functions.