Spatial
Simple Static Analysis in LLVM
LFCPAInstModel.h
Go to the documentation of this file.
1#ifndef LFCPAINSTMODEL_LFCPAINSTMODEL_H
2#define LFCPAINSTMODEL_LFCPAINSTMODEL_H
3
4#include "InstInfo/InstInfo.h"
6#include "Token/Token.h"
7
8#include "vector"
9#include "llvm/IR/Argument.h"
10#include "llvm/IR/Function.h"
11#include "llvm/IR/GlobalVariable.h"
12#include "llvm/IR/Instruction.h"
13#include "llvm/IR/Instructions.h"
14#include "llvm/IR/Operator.h"
15
16namespace spatial {
17
18class LFCPAInstModel : public InstModel {
19 std::map<llvm::Instruction *, spatial::InstInfo *> InstInfoMap;
20
21public:
23
25 std::vector<int> extractRedirections(llvm::Instruction *);
26 InstInfo extractInstInfo(llvm::Instruction *);
27
28 std::vector<Token *> extractToken(llvm::Instruction *);
29 std::vector<Token *> extractToken(llvm::StoreInst *);
30 std::vector<Token *> extractToken(llvm::LoadInst *);
31 std::vector<Token *> extractToken(llvm::PHINode *);
32 std::vector<Token *> extractToken(llvm::AllocaInst *);
33 std::vector<Token *> extractToken(llvm::BitCastInst *);
34 std::vector<Token *> extractToken(llvm::ReturnInst *);
35 std::vector<Token *> extractToken(llvm::GetElementPtrInst *);
36 std::vector<Token *> extractToken(llvm::GlobalVariable *);
37 std::vector<Token *> extractToken(llvm::CallInst *);
38 std::vector<Token *> extractToken(llvm::CmpInst *);
39 std::vector<Token *> extractToken(llvm::Argument *, llvm::Function *);
40
41 std::vector<int> extractRedirections(llvm::GlobalVariable *);
42 template <typename GEP> Token *handleGEPUtil(GEP *, Token *);
43 bool isInstSkip(llvm::Instruction *);
44 template <typename GOP> bool isStructFieldPointerTy(GOP *);
45 template <typename GOP> bool isArrayType(GOP *);
46 Token *extractDummy(std::string);
47 void setSkipIns(llvm::Instruction *);
48};
49} // namespace spatial
50#endif
Definition: InstInfo.h:10
Definition: InstModel.h:12
InstModel(TokenWrapper *TW)
Definition: InstModel.cpp:5
Definition: LFCPAInstModel.h:18
InstInfo extractInstInfo(llvm::Instruction *)
Definition: LFCPAInstModel.cpp:10
std::vector< int > extractRedirections(llvm::Instruction *)
Definition: LFCPAInstModel.cpp:414
Token * handleGEPUtil(GEP *, Token *)
handleGEPUtil - Returns the extended field value for a GEP
Definition: LFCPAInstModel.cpp:480
bool isStructFieldPointerTy(GOP *)
Definition: LFCPAInstModel.cpp:499
bool isArrayType(GOP *)
Returns true if operand is of array type.
Definition: LFCPAInstModel.cpp:514
~LFCPAInstModel()
Definition: LFCPAInstModel.cpp:550
bool isInstSkip(llvm::Instruction *)
Definition: LFCPAInstModel.cpp:552
std::vector< Token * > extractToken(llvm::Instruction *)
Definition: LFCPAInstModel.cpp:17
void setSkipIns(llvm::Instruction *)
Definition: LFCPAInstModel.cpp:562
Token * extractDummy(std::string)
Definition: LFCPAInstModel.cpp:545
Definition: Token.h:29
Definition: PointsToBenchmark.cpp:19