Jlm
Loading...
Searching...
No Matches
operation.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2014 Helge Bahmann <hcb@chaoticmind.net>
3 * Copyright 2011 2012 2014 Nico Reißmann <nico.reissmann@gmail.com>
4 * See COPYING for terms of redistribution.
5 */
6
7#include <jlm/rvsdg/graph.hpp>
8
9namespace jlm::rvsdg
10{
11
13
14SimpleOperation::~SimpleOperation() noexcept = default;
15
16size_t
18{
19 return operands_.size();
20}
21
22const std::shared_ptr<const rvsdg::Type> &
23SimpleOperation::argument(size_t index) const noexcept
24{
25 JLM_ASSERT(index < narguments());
26 return operands_[index];
27}
28
29size_t
34
35const std::shared_ptr<const rvsdg::Type> &
36SimpleOperation::result(size_t index) const noexcept
37{
38 JLM_ASSERT(index < nresults());
39 return results_[index];
40}
41
42bool
44{
45 return typeid(*this) == typeid(other);
46}
47
48}
virtual ~Operation() noexcept
const std::shared_ptr< const rvsdg::Type > & argument(size_t index) const noexcept
Definition operation.cpp:23
const std::shared_ptr< const rvsdg::Type > & result(size_t index) const noexcept
Definition operation.cpp:36
size_t nresults() const noexcept
Definition operation.cpp:30
std::vector< std::shared_ptr< const rvsdg::Type > > results_
Definition operation.hpp:82
bool operator==(const Operation &other) const noexcept override
Definition operation.cpp:43
#define JLM_ASSERT(x)
Definition common.hpp:16
NodeType * TryGetOwnerNode(const rvsdg::Input &input) noexcept
Checks if this is an input to a node of specified type.
Definition node.hpp:872