P4C
The P4 Compiler
Loading...
Searching...
No Matches
ir_compare.h
1/*
2 * SPDX-FileCopyrightText: 2024 The P4 Language Consortium
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef BACKENDS_P4TOOLS_COMMON_LIB_IR_COMPARE_H_
8#define BACKENDS_P4TOOLS_COMMON_LIB_IR_COMPARE_H_
9
10#include "ir/ir.h"
11
12namespace P4::IR {
13
16 bool operator()(const IR::StateVariable *s1, const IR::StateVariable *s2) const {
17 return s1->equiv(*s2);
18 }
19 bool operator()(const IR::StateVariable &s1, const IR::StateVariable &s2) const {
20 return s1.equiv(s2);
21 }
22};
23
26 bool operator()(const IR::StateVariable *s1, const IR::StateVariable *s2) const {
27 return *s1 < *s2;
28 }
29 bool operator()(const IR::StateVariable &s1, const IR::StateVariable &s2) const {
30 return s1 < s2;
31 }
32};
33
34} // namespace P4::IR
35
36#endif /* BACKENDS_P4TOOLS_COMMON_LIB_IR_COMPARE_H_ */
Definition constantParsing.h:22
Equals for StateVariable pointers. We only compare the label.
Definition ir_compare.h:15
Less for StateVariable pointers. We only compare the label.
Definition ir_compare.h:25