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