Jlm
AggregateOperations.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2026 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 ExtractValueOperation::operator==(const Operation & other) const noexcept
15 {
16  auto op = dynamic_cast<const ExtractValueOperation *>(&other);
17  return op && op->indices_ == indices_ && op->type() == type();
18 }
19 
20 std::string
22 {
23  return "ExtractValue";
24 }
25 
26 std::unique_ptr<rvsdg::Operation>
28 {
29  return std::make_unique<ExtractValueOperation>(*this);
30 }
31 
33 
34 std::string
35 InsertValueOperation::debug_string() const
36 {
37  return "InsertValue";
38 }
39 
40 std::unique_ptr<rvsdg::Operation>
42 {
44 }
45 
46 bool
47 InsertValueOperation::operator==(const Operation & other) const noexcept
48 {
49  const auto operation = dynamic_cast<const InsertValueOperation *>(&other);
50  return operation && operation->getAggregateType() == getAggregateType()
51  && operation->getValueType() == getValueType() && operation->getIndices() == getIndices();
52 }
53 
54 }
std::unique_ptr< Operation > copy() const override
std::string debug_string() const override
~ExtractValueOperation() noexcept override
~InsertValueOperation() noexcept override
std::unique_ptr< Operation > copy() const override
const std::vector< unsigned > & getIndices() const noexcept
bool operator==(const Operation &other) const noexcept override
const std::shared_ptr< const rvsdg::Type > & getValueType() const noexcept
const std::shared_ptr< const rvsdg::Type > & getAggregateType() const noexcept
static std::unique_ptr< InsertValueOperation > create(const std::shared_ptr< const rvsdg::Type > &aggregateType, const std::shared_ptr< const rvsdg::Type > &valueType, std::vector< unsigned > indices)
Global memory state passed between functions.