Skip to content

Commit dbbf2ca

Browse files
feat(finite_automata): Update RegisterOperation API by adding: (#111)
1 parent 757568b commit dbbf2ca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/log_surgeon/finite_automata/RegisterOperation.hpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ class RegisterOperation {
2424
Negate
2525
};
2626

27+
bool operator==(RegisterOperation const& rhs) const {
28+
return m_reg_id == rhs.m_reg_id && m_type == rhs.m_type
29+
&& m_copy_reg_id == rhs.m_copy_reg_id;
30+
}
31+
2732
static auto create_set_operation(reg_id_t const reg_id) -> RegisterOperation {
2833
return {reg_id, Type::Set};
2934
}
@@ -43,6 +48,8 @@ class RegisterOperation {
4348

4449
[[nodiscard]] auto get_type() const -> Type { return m_type; }
4550

51+
[[nodiscard]] auto get_copy_reg_id() const -> std::optional<reg_id_t> { return m_copy_reg_id; }
52+
4653
/**
4754
* Serializes the register operation into a string representation.
4855
*

0 commit comments

Comments
 (0)