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
12
namespace
P4::IR
{
13
15
struct
SymbolicVariableEqual
{
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
25
struct
SymbolicVariableLess
{
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_ */
P4::IR
Definition
constantParsing.h:22
P4::IR::SymbolicVariableEqual
Equals for SymbolicVariable pointers. We only compare the label.
Definition
compare.h:15
P4::IR::SymbolicVariableLess
Less for SymbolicVariable pointers. We only compare the label.
Definition
compare.h:25
ir
compare.h
Generated by
1.13.2