-
Notifications
You must be signed in to change notification settings - Fork 0
/
PDG.h
38 lines (32 loc) · 945 Bytes
/
PDG.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
#ifndef PDG_H
#define PDG_H
#include "Atomic.h"
#include "CDG.h"
#include "DDG.h"
#include "SourceManager.h"
using DeclIdx = std::pair<const clang::DeclStmt *, unsigned>;
using DataAtomMap = std::map<AtomBlock*, DDGBlock*>;
class PDG {
AtomicCFG *acfg;
DDG *ddg;
CDG *cdg;
clang::ASTContext *Ctx;
const clang::FunctionDecl *CurrentFunction;
BlockSet pdg_blocks;
std::map<AtomBlock *, DeclIdx> realSynth;
DataAtomMap DAM;
public:
PDG(AtomicCFG *acfg, DDG *ddg, CDG *cdg, clang::ASTContext *Ctx,
const clang::FunctionDecl *Function)
: acfg(acfg), ddg(ddg), cdg(cdg), Ctx(Ctx), CurrentFunction(Function) {
makeGraph();
}
void prettyPrint(std::stringstream& outs);
void prettyCDPrint(std::string base_name);
void makeStmtStr(AtomBlock *AB, std::string &jStr);
DeclIdx findDecl(clang::DeclStmt *DS);
const BlockSet &getBlocks() { return pdg_blocks; }
private:
void makeGraph();
};
#endif // PDG_H