Static Value-Flow Analysis
Loading...
Searching...
No Matches
PreAnalysis.h
Go to the documentation of this file.
1//===- PreAnalysis.h -- Pre-Analysis for Abstract Interpretation----------//
2//
3// SVF: Static Value-Flow Analysis
4//
5// Copyright (C) <2013-> <Yulei Sui>
6//
7
8// This program is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Affero General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12
13// This program is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// GNU Affero General Public License for more details.
17
18// You should have received a copy of the GNU Affero General Public License
19// along with this program. If not, see <http://www.gnu.org/licenses/>.
20//
21//===----------------------------------------------------------------------===//
22
23/*
24 * PreAnalysis.h
25 *
26 * Created on: Feb 25, 2026
27 * Author: Jiawei Wang
28 *
29 * This file provides a pre-analysis phase for Abstract Interpretation.
30 * It runs Andersen's pointer analysis and builds WTO (Weak Topological Order)
31 * for each function before the main abstract interpretation.
32 */
33
34#ifndef INCLUDE_AE_SVFEXE_PREANALYSIS_H_
35#define INCLUDE_AE_SVFEXE_PREANALYSIS_H_
36
37#include "SVFIR/SVFIR.h"
38#include "Graphs/ICFG.h"
39#include "Graphs/CallGraph.h"
40#include "Graphs/SCC.h"
41#include "AE/Core/ICFGWTO.h"
42#include "WPA/Andersen.h"
43
44namespace SVF
45{
46
48{
49public:
51
52 PreAnalysis(SVFIR* pag, ICFG* icfg);
53 virtual ~PreAnalysis();
54
57 {
58 return pta;
59 }
61 {
62 return callGraph;
63 }
65 {
66 return callGraphSCC;
67 }
68 SVFG* getSVFG() const
69 {
70 return svfg;
71 }
73 const Set<const ICFGNode*> getUseSitesOfObjVar(const ObjVar* obj, const ICFGNode* node) const;
74
78
81 const ICFGNode* getDefSiteOfValVar(const ValVar* var) const;
82
85 const ICFGNode* getDefSiteOfObjVar(const ObjVar* obj, const ICFGNode* node) const;
86
88 void initWTO();
89
95
96private:
103
105};
106
107} // End namespace SVF
108
109#endif /* INCLUDE_AE_SVFEXE_PREANALYSIS_H_ */
const ICFGNode * getDefSiteOfObjVar(const ObjVar *obj, const ICFGNode *node) const
SCCDetection< CallGraph * > CallGraphSCC
Definition PreAnalysis.h:50
const Map< const FunObjVar *, const ICFGWTO * > & getFuncToWTO() const
Accessors for WTO data.
Definition PreAnalysis.h:91
const Set< const ICFGNode * > getUseSitesOfValVar(const ValVar *var) const
CallGraphSCC * getCallGraphSCC() const
Definition PreAnalysis.h:64
Map< const FunObjVar *, const ICFGWTO * > funcToWTO
const ICFGNode * getDefSiteOfValVar(const ValVar *var) const
const Set< const ICFGNode * > getUseSitesOfObjVar(const ObjVar *obj, const ICFGNode *node) const
Given an ObjVar and its def-site ICFGNode, find all use-site ICFGNodes.
SVFG * getSVFG() const
Definition PreAnalysis.h:68
CallGraphSCC * callGraphSCC
AndersenWaveDiff * pta
virtual ~PreAnalysis()
AndersenWaveDiff * getPointerAnalysis() const
Accessors for Andersen's results.
Definition PreAnalysis.h:56
CallGraph * callGraph
void initWTO()
Build WTO for each function using call graph SCC.
CallGraph * getCallGraph() const
Definition PreAnalysis.h:60
for isBitcode
Definition BasicTypes.h:68
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74