klee
ExprHashMap.h
Go to the documentation of this file.
1//===-- ExprHashMap.h -------------------------------------------*- C++ -*-===//
2//
3// The KLEE Symbolic Virtual Machine
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef KLEE_EXPRHASHMAP_H
11#define KLEE_EXPRHASHMAP_H
12
13#include "klee/Expr/Expr.h"
14
15#include <unordered_map>
16#include <unordered_set>
17
18namespace klee {
19
20 namespace util {
21 struct ExprHash {
22 unsigned operator()(const ref<Expr> &e) const { return e->hash(); }
23 };
24
25 struct ExprCmp {
26 bool operator()(const ref<Expr> &a, const ref<Expr> &b) const {
27 return a==b;
28 }
29 };
30 }
31
32 template <class T>
34 : public std::unordered_map<ref<Expr>, T, klee::util::ExprHash,
35 klee::util::ExprCmp> {};
36
37 typedef std::unordered_set<ref<Expr>, klee::util::ExprHash,
40} // namespace klee
41
42#endif /* KLEE_EXPRHASHMAP_H */
virtual unsigned hash() const
Returns the pre-computed hash of the current expression.
Definition: Expr.h:222
Definition: main.cpp:291
std::unordered_set< ref< Expr >, klee::util::ExprHash, klee::util::ExprCmp > ExprHashSet
Definition: ExprHashMap.h:39
bool operator()(const ref< Expr > &a, const ref< Expr > &b) const
Definition: ExprHashMap.h:26
unsigned operator()(const ref< Expr > &e) const
Definition: ExprHashMap.h:22