未验证 提交 104a518c 编写于 作者: W winter-wang 提交者: GitHub

[IR] polish the concrete op api (#54928)

上级 7ace52ba
...@@ -78,9 +78,9 @@ op_n_attribute_declare_str = ( ...@@ -78,9 +78,9 @@ op_n_attribute_declare_str = (
"static const char *attributes_name[{attribute_num}];" "static const char *attributes_name[{attribute_num}];"
) )
OP_GET_INPUT_TEMPLATE = """ ir::OpOperand {input_name}() {{ return operation()->op_operand({input_index}); }} OP_GET_INPUT_TEMPLATE = """ ir::Value {input_name}() {{ return operand({input_index}); }}
""" """
OP_GET_OUTPUT_TEMPLATE = """ ir::OpResult {output_name}() {{ return operation()->result({output_index}); }} OP_GET_OUTPUT_TEMPLATE = """ ir::OpResult {output_name}() {{ return result({output_index}); }}
""" """
# ===================================== # =====================================
......
...@@ -84,6 +84,10 @@ class IR_API OpBase { ...@@ -84,6 +84,10 @@ class IR_API OpBase {
const AttributeMap &attributes() const { return operation_->attributes(); } const AttributeMap &attributes() const { return operation_->attributes(); }
Value operand(uint32_t index) const { return operation_->operand(index); }
OpResult result(uint32_t index) const { return operation_->result(index); }
private: private:
Operation *operation_; // Not owned Operation *operation_; // Not owned
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册