-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLogFunctionManager.hpp
More file actions
42 lines (33 loc) · 1000 Bytes
/
LogFunctionManager.hpp
File metadata and controls
42 lines (33 loc) · 1000 Bytes
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
#ifndef LOGFUNCTIONMANAGER_HPP
#define LOGFUNCTIONMANAGER_HPP
#include "llvm/IR/Function.h"
#include "llvm/IR/Module.h"
#include <string>
#include <iostream>
enum value_types {
FLOAT = 0, INTEGER, VALUE_TYPES_MAX
};
enum value_sizes {
S8 = 0, S16, S32, S64, VALUE_SIZES_MAX
};
using namespace llvm;
using namespace std;
class LogFunctionManager {
private:
string getInstrumentationLibPath();
Function *loadExternalFunction(Module *m, Module *extM, const char *name);
public:
Function *logFunctions[VALUE_TYPES_MAX][VALUE_SIZES_MAX];
Function *ptrLogFunc;
Function *stringLogFunc;
Function *allocLogFunc;
Function *fnBeginLogFunc;
Function *fnEndLogFunc;
Function *initLogFunc;
Function *exitLogFunc;
int getSizeIndex(int size);
void loadFunctions(Module *m);
Function *getLogFunction(Value *v, Function *parent);
bool isLogFunction(Function *f);
};
#endif