5 #ifndef CLEARBLUE_YAPSACHECKER_H
6 #define CLEARBLUE_YAPSACHECKER_H
11 #include "Analysis/Bitcode/TSDataLayout.h"
12 #include "Analysis/CFG/CFGReachabilityAnalysis.h"
13 #include "Analysis/GVFA/NullPtrAnalysis.h"
14 #include "Analysis/Graph/DomTreePass.h"
15 #include "Analysis/TypeInference/TypeInference.h"
16 #include "Checker/PSA/PSAChecker.h"
17 #include "Checker/PSA/SymbolicSummary.h"
18 #include "Checker/PSA/TraceSummary.h"
19 #include "Checker/Sailfish/BotUpParallelPass.h"
20 #include "Checker/Sailfish/SummaryMapper.h"
21 #include "IR/SEG/SymbolicExprGraph.h"
22 #include "IR/SEG/SymbolicExprGraphBuilder.h"
23 #include "Report/BugReport/Reporter.h"
26 StringRef FunctionName;
28 size_t NumStartedPoints;
29 size_t NumProducedSummaries;
32 StatisticsEntry(StringRef FN, StringRef TN,
size_t NSP,
size_t NPS,
size_t RT)
33 : FunctionName(FN), TaskName(TN), NumStartedPoints(NSP),
34 NumProducedSummaries(NPS), RunningTime(RT) {}
38 std::vector<std::pair<int, std::shared_ptr<VulnerabilityTrace>>> VulnTraces;
39 std::vector<StatisticsEntry> Statistics;
47 DomTreePass *DTP =
nullptr;
49 NullPtrAnalysis *NPA =
nullptr;
50 CFGReachabilityAnalysis *CRA =
nullptr;
51 TSDataLayout *TDL =
nullptr;
52 ExternalMemorySpec *MemSepc =
nullptr;
53 ExternalIOSpec *IOSpec =
nullptr;
54 ExternalTaintSpec *TaintSpec =
nullptr;
56 DebugInfoAnalysis *DIA =
nullptr;
57 InstResolver *IResolver =
nullptr;
58 ControlDependenceAnalysis *CDGs =
nullptr;
59 TypeInference *Infer =
nullptr;
63 SMTAdvisor4Inlining SMTAdvisor;
66 std::map<const Function *, SailfishSummary *> FuncSummaryMap;
69 std::shared_ptr<VulnerabilityWrapper> Vuln;
79 virtual void getAnalysisUsage(AnalysisUsage &AU)
const override;
81 virtual bool runOnModule(Module &M)
override;
86 unsigned CalleeTaskID)
override;
88 virtual bool runOnFunction(Function &
F)
override;
90 virtual bool runOnFunction(Function &
F,
unsigned TaskID)
override;
94 virtual std::string getName() {
return "PSA-PPL"; }
98 virtual CBCallGraph *getCG()
override {
return CG; }
100 virtual DomTreePass *getDTP()
override {
return DTP; }
102 virtual TSDataLayout *getDL()
override {
return TDL; };
104 virtual DebugInfoAnalysis *getDIA()
override {
return DIA; };
106 ExternalMemorySpec *getMemSpec()
override {
return MemSepc; };
108 ExternalIOSpec *getIOSpec()
override {
return IOSpec; };
110 ExternalTaintSpec *getTaintSpec()
override {
return TaintSpec; };
113 bool initialization(Module &);
115 bool finalization(Module &);
119 void buildVFFromRet(Function &
F);
121 void buildVFFromParam(Function &
F);
123 void buildVFFromErSrc(Function &
F);
125 void buildVFFromSrcWp(Function &
F);
127 void buildVFFromCSOut(Function &
F);
130 #endif // CLEARBLUE_YAPSACHECKER_H