/
LLVMInstructionMap.h
52 lines (37 loc) · 1.39 KB
/
LLVMInstructionMap.h
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
44
45
46
47
48
49
50
51
52
#ifndef LLVM_INSTRUCTION_MAP_HPP
#define LLVM_INSTRUCTION_MAP_HPP
#include <map>
#include <vector>
#include "CompilationDataMap.h"
namespace clang_mutate{
typedef std::vector<std::string> Instructions;
class LLVMInstructionMap : public CompilationDataMap<Instructions> {
public:
typedef std::map<unsigned int, Instructions>
LineNumsToInstructionsMap;
typedef std::map<std::string, LineNumsToInstructionsMap> FilesMap;
// Construct an empty LLVMInstructionMap
LLVMInstructionMap();
// Initialize a LLVMInstructionMap from a LLVM file
LLVMInstructionMap(const std::string &llvmPath);
// Copy Constructor
LLVMInstructionMap(const LLVMInstructionMap& other);
// Overloaded assignment operator
LLVMInstructionMap& operator=(const LLVMInstructionMap& other);
// Destructor
virtual ~LLVMInstructionMap();
// Return true if the LLVMInstructionMap is empty
virtual bool isEmpty() const override;
// Return the path to the LLVM file utilized to populate the map
virtual std::string getPath() const override;
// Return the instructions corresponding to the given file/line range.
virtual Utils::Optional<Instructions>
getCompilationData(const std::string& filePath,
const LineRange& lineRange)
const override;
private:
std::string m_llvmPath;
FilesMap m_filesMap;
};
}
#endif