22 int generateEncodings(llvm::Module &M, IR2VecMode mode,
char level =
'\0',
23 std::string funcName =
"",
unsigned dim = 300,
24 std::ostream *o =
nullptr,
int cls = -1,
float WO = 1,
25 float WA = 0.2,
float WT = 0.5);
27 llvm::SmallMapVector<const llvm::Instruction *, Vector, 128> instVecMap;
28 llvm::SmallMapVector<const llvm::BasicBlock *, IR2Vec::Vector, 16> bbVecMap;
29 llvm::SmallMapVector<const llvm::Function *, Vector, 16> funcVecMap;
31 std::map<std::string, IR2Vec::Vector> vocabulary;
35 Embeddings(llvm::Module &M, IR2VecMode mode,
unsigned dim = 300,
36 std::string funcName =
"",
float WO = 1,
float WA = 0.2,
38 vocabulary = VocabularyFactory::createVocabulary(dim)->getVocabulary();
39 generateEncodings(M, mode,
'\0', funcName, dim,
nullptr, -1, WO, WA, WT);
45 Embeddings(llvm::Module &M, IR2VecMode mode,
char level, std::ostream *o,
46 unsigned dim = 300, std::string funcName =
"",
float WO = 1,
47 float WA = 0.2,
float WT = 0.5) {
48 vocabulary = VocabularyFactory::createVocabulary(dim)->getVocabulary();
49 generateEncodings(M, mode, level, funcName, dim, o, -1, WO, WA, WT);
55 llvm::SmallMapVector<const llvm::Instruction *, Vector, 128> &
63 llvm::SmallMapVector<const llvm::BasicBlock *, IR2Vec::Vector, 16>
71 llvm::SmallMapVector<const llvm::Function *, Vector, 16> &
78 Vector &getProgramVector() {
return pgmVector; }