klee
InstructionInfoTable.h
Go to the documentation of this file.
1//===-- InstructionInfoTable.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_INSTRUCTIONINFOTABLE_H
11#define KLEE_INSTRUCTIONINFOTABLE_H
12
13#include <memory>
14#include <string>
15#include <unordered_map>
16#include <vector>
17
18namespace llvm {
19 class Function;
20 class Instruction;
21 class Module;
22}
23
24namespace klee {
25
29 unsigned id;
31 unsigned line;
33 unsigned column;
35 unsigned assemblyLine;
37 const std::string &file;
38
39 public:
40 InstructionInfo(unsigned id, const std::string &file, unsigned line,
41 unsigned column, unsigned assemblyLine)
43 };
44
46 struct FunctionInfo {
48 unsigned id;
50 unsigned line;
52 uint64_t assemblyLine;
54 const std::string &file;
55
56 public:
57 FunctionInfo(unsigned id, const std::string &file, unsigned line, uint64_t assemblyLine)
59
60 FunctionInfo(const FunctionInfo &) = delete;
62
64 };
65
67 std::unordered_map<const llvm::Instruction *,
68 std::unique_ptr<InstructionInfo>>
70 std::unordered_map<const llvm::Function *, std::unique_ptr<FunctionInfo>>
72 std::vector<std::unique_ptr<std::string>> internedStrings;
73
74 public:
75 explicit InstructionInfoTable(const llvm::Module &m);
76
77 unsigned getMaxID() const;
78 const InstructionInfo &getInfo(const llvm::Instruction &) const;
79 const FunctionInfo &getFunctionInfo(const llvm::Function &) const;
80 };
81
82}
83
84#endif /* KLEE_INSTRUCTIONINFOTABLE_H */
std::unordered_map< const llvm::Instruction *, std::unique_ptr< InstructionInfo > > infos
const FunctionInfo & getFunctionInfo(const llvm::Function &) const
const InstructionInfo & getInfo(const llvm::Instruction &) const
InstructionInfoTable(const llvm::Module &m)
std::unordered_map< const llvm::Function *, std::unique_ptr< FunctionInfo > > functionInfos
std::vector< std::unique_ptr< std::string > > internedStrings
Definition: main.cpp:291
FunctionInfo stores debug information for a KFunction.
FunctionInfo(FunctionInfo &&)=default
unsigned line
Line number in source file.
FunctionInfo(unsigned id, const std::string &file, unsigned line, uint64_t assemblyLine)
const std::string & file
Source file name.
uint64_t assemblyLine
Line number in generated assembly.ll.
FunctionInfo(const FunctionInfo &)=delete
unsigned id
The function id.
FunctionInfo & operator=(FunctionInfo const &)=delete
InstructionInfo stores debug information for a KInstruction.
unsigned column
Column number in source file.
const std::string & file
Source file name.
unsigned assemblyLine
Line number in generated assembly.ll.
unsigned line
Line number in source file.
InstructionInfo(unsigned id, const std::string &file, unsigned line, unsigned column, unsigned assemblyLine)
unsigned id
The instruction id.