26void Operation::Output::removeUse(Operation::Use use)
28 auto it = std::remove(_uses.begin(), _uses.end(), use);
34 for (
auto use : _uses)
36 use.getNode()->_inputs[use.getIndex()] = new_def;
45 for (std::size_t i = 0; i < inputs.size(); ++i)
47 inputs[i]->addUse(
Use(
this, i));
48 _inputs.push_back(inputs[i]);
50 for (std::size_t i = 0; i < num_outputs; ++i)
52 _outputs.emplace_back(
this, i);
60#define HANDLE_OP(OpType, OpClass) \
62 v->visit(dynamic_cast<ops::OpClass &>(*this)); \
67 assert(
false &&
"OP not defined!");
75#define HANDLE_OP(OpType, OpClass) \
76 case Operation::Type::OpType: \
78 static const std::string name(#OpType); \
84 throw std::runtime_error(
"unexpected opcode");
Interface for visitors Use in MIR component if you want to enforce to implement visits for all operat...
Represents an output of a node.
void addUse(Use use)
Adds the specified use to the uses of this output.
Operation(OperandConstraint input_constr, const OperandIndexSequence &inputs, const OperandIndexSequence &outputs, OperandConstraint output_constr=OperandConstraint::createAny())
const std::string & getTypeName(Operation::Type type)
Represents a use of an operation output.
virtual void accept(OperationVisitor &v) const =0