about summary refs log tree commit diff homepage
path: root/lib/Core/Differentiator.h
blob: 54a12ac74ca76e2a64ec704b4de47c26a5d57a49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//===-- Differentiator.h ----------------------------------------*- C++ -*-===//
//
//                     The KLEE Symbolic Virtual Machine
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Class to perform actual execution, hides implementation details from external
// interpreter.
//
//===----------------------------------------------------------------------===//

#ifndef KLEE_DIFFERENTIATOR_H
#define KLEE_DIFFERENTIATOR_H

#include "llvm/Support/raw_ostream.h"

#include <cstdint>
#include <map>
#include <string>

namespace klee {

/// Return if name matches arg\d\d
bool isSymArg(std::string);

/// Return if name matches out!.*\d
bool isSymOut(std::string);

struct Differentiator {
  uint64_t revA, revB;
  std::map<uint8_t, std::string> args;
  std::map<std::string, std::pair<std::string, std::string>> outputs;
  Differentiator(uint64_t a, uint64_t b) : revA{a}, revB{b} {}
};

/// Write convenient representation for debugging
llvm::raw_ostream &operator<<(llvm::raw_ostream&, const Differentiator&);
} // End klee namespace

#endif /* KLEE_DIFFERENTIATOR_H */