P4C
The P4 Compiler
Loading...
Searching...
No Matches
ir_compare.h
1#ifndef BACKENDS_P4TOOLS_COMMON_LIB_IR_COMPARE_H_
2#define BACKENDS_P4TOOLS_COMMON_LIB_IR_COMPARE_H_
3
4#include "ir/ir.h"
5
6namespace P4::IR {
7
10 bool operator()(const IR::StateVariable *s1, const IR::StateVariable *s2) const {
11 return s1->equiv(*s2);
12 }
13 bool operator()(const IR::StateVariable &s1, const IR::StateVariable &s2) const {
14 return s1.equiv(s2);
15 }
16};
17
20 bool operator()(const IR::StateVariable *s1, const IR::StateVariable *s2) const {
21 return *s1 < *s2;
22 }
23 bool operator()(const IR::StateVariable &s1, const IR::StateVariable &s2) const {
24 return s1 < s2;
25 }
26};
27
28} // namespace P4::IR
29
30#endif /* BACKENDS_P4TOOLS_COMMON_LIB_IR_COMPARE_H_ */
Equals for StateVariable pointers. We only compare the label.
Definition ir_compare.h:9
Less for StateVariable pointers. We only compare the label.
Definition ir_compare.h:19