summaryrefslogtreecommitdiff
path: root/mediumlevelilinstruction.h
diff options
context:
space:
mode:
Diffstat (limited to 'mediumlevelilinstruction.h')
-rw-r--r--mediumlevelilinstruction.h25
1 files changed, 17 insertions, 8 deletions
diff --git a/mediumlevelilinstruction.h b/mediumlevelilinstruction.h
index a1f8e00d..077ced5b 100644
--- a/mediumlevelilinstruction.h
+++ b/mediumlevelilinstruction.h
@@ -60,16 +60,25 @@ namespace BinaryNinja
struct SSAVariable
{
Variable var;
- size_t version;
+ size_t version = 0;
- SSAVariable();
- SSAVariable(const Variable& v, size_t i);
- SSAVariable(const SSAVariable& v);
+ // TODO: `= default` these when we can rely on C++20
+ bool operator==(const SSAVariable& other) const
+ {
+ return var == other.var && version == other.version;
+ }
- SSAVariable& operator=(const SSAVariable& v);
- bool operator==(const SSAVariable& v) const;
- bool operator!=(const SSAVariable& v) const;
- bool operator<(const SSAVariable& v) const;
+ bool operator!=(const SSAVariable& other) const
+ {
+ return !(*this == other);
+ }
+
+ bool operator<(const SSAVariable& other) const
+ {
+ if (var != other.var)
+ return var < other.var;
+ return version < other.version;
+ }
};
/*!