MimIR
0.4-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
gid.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <absl/container/flat_hash_map.h>
4
#include <absl/container/flat_hash_set.h>
5
#include <absl/container/node_hash_map.h>
6
#include <absl/container/node_hash_set.h>
7
#include <fe/hash.h>
8
9
namespace
mim
{
10
11
template
<
class
T>
12
struct
GIDHash
{
13
constexpr
size_t
operator()
(T p)
const
noexcept
{
return
fe::hash(p->gid()); }
14
};
15
16
template
<
class
T>
17
struct
GIDLt
{
18
constexpr
bool
operator()
(T a, T b)
const
noexcept
{
return
a->gid() < b->gid(); }
19
};
20
21
// clang-format off
22
/// @name GID
23
///@{
24
template
<
class
K,
class
V>
using
GIDMap
= absl::flat_hash_map<K, V, GIDHash<K>>;
25
template
<
class
K>
using
GIDSet
= absl::flat_hash_set<K, GIDHash<K>>;
26
template
<
class
K,
class
V>
using
GIDNodeMap
= absl::node_hash_map<K, V, GIDHash<K>>;
27
template
<
class
K>
using
GIDNodeSet
= absl::node_hash_set<K, GIDHash<K>>;
28
///@}
29
// clang-format on
30
31
}
// namespace mim
mim
Definition
ast.h:16
mim::GIDMap
absl::flat_hash_map< K, V, GIDHash< K > > GIDMap
Definition
gid.h:24
mim::GIDNodeSet
absl::node_hash_set< K, GIDHash< K > > GIDNodeSet
Definition
gid.h:27
mim::GIDNodeMap
absl::node_hash_map< K, V, GIDHash< K > > GIDNodeMap
Definition
gid.h:26
mim::GIDSet
absl::flat_hash_set< K, GIDHash< K > > GIDSet
Definition
gid.h:25
mim::GIDHash
Definition
gid.h:12
mim::GIDHash::operator()
constexpr size_t operator()(T p) const noexcept
Definition
gid.h:13
mim::GIDLt
Definition
gid.h:17
mim::GIDLt::operator()
constexpr bool operator()(T a, T b) const noexcept
Definition
gid.h:18
include
mim
util
gid.h
Generated by
1.18.0