-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPMConfig.h
More file actions
38 lines (33 loc) · 1.17 KB
/
PMConfig.h
File metadata and controls
38 lines (33 loc) · 1.17 KB
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
#ifndef LLVM_LIB_ANALYSIS_TAINT_KNOWN_FUNCTIONS_CONFIG_H
#define LLVM_LIB_ANALYSIS_TAINT_KNOWN_FUNCTIONS_CONFIG_H
#include <cstdint>
#include <stdlib.h>
//#define ALL_ALLOC_FN_PMEM 1
//#define UNKNOWN_ESCAPED_PMEM 1
struct NameAnnoPair {
std::string FnName;
std::string Anno;
};
static const std::string PMAllocAnno = "pm_allocator";
//A pm_allocator annotation has the format
// OPERAND = "r" | "0" | "1" | "2" | ....
// LEVEL = "0" | "1" | "2" | ...
// ANNO = OPERAND "," LEVEL
// ANNOS = ANNO ("|" ANNO)+
// where the operand r stands for return value, 0 stands for the first argument, 1 the second argument etc.
// the levels stand for the pointer dereference level
static const NameAnnoPair PMAllocatorAnnos[] = {
//libpmem
NameAnnoPair{"pmem_map_file", "r,0"},
//pmdk/common
NameAnnoPair{"util_map_sync", "r,0"},
//libpmemobj
NameAnnoPair{"_ZL21pmemobj_direct_inline7pmemoid", "r,0"}, //pmemobj_direct_inline(pmemoid)
//libpmemobj
NameAnnoPair{"pmemobj_direct_inline", "r,0"}, //pmemobj_direct_inline(pmemoid)
//general purpose
NameAnnoPair{"mmap", "r,0|0,0"},
//libpmem2
NameAnnoPair{"file_map", "6,1"},
};
#endif //LLVM_LIB_ANALYSIS_TAINT_KNOWN_FUNCTIONS_CONFIG_H