svf-lib 1.0.2237 → 1.0.2239
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/SVF-linux-aarch64/Release-build/bin/ae +0 -0
- package/SVF-linux-aarch64/Release-build/bin/cfl +0 -0
- package/SVF-linux-aarch64/Release-build/bin/dvf +0 -0
- package/SVF-linux-aarch64/Release-build/bin/llvm2svf +0 -0
- package/SVF-linux-aarch64/Release-build/bin/mta +0 -0
- package/SVF-linux-aarch64/Release-build/bin/saber +0 -0
- package/SVF-linux-aarch64/Release-build/bin/svf-ex +0 -0
- package/SVF-linux-aarch64/Release-build/bin/wpa +0 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Core/AbstractState.h +406 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Core/AbstractValue.h +157 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Core/AddressValue.h +232 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Core/ICFGWTO.h +82 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Core/IntervalValue.h +1055 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Core/NumericValue.h +1292 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Core/RelExeState.h +226 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Core/RelationSolver.h +91 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Svfexe/AEDetector.h +323 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Svfexe/AbsExtAPI.h +140 -0
- package/SVF-linux-aarch64/Release-build/include/AE/Svfexe/AbstractInterpretation.h +350 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFGNormalizer.h +84 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFGrammar.h +468 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFLAlias.h +168 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFLBase.h +118 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFLGramGraphChecker.h +74 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFLGraphBuilder.h +166 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFLSVFGBuilder.h +58 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFLSolver.h +374 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFLStat.h +67 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/CFLVF.h +68 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/GrammarBuilder.h +100 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/grammar/PAGGrammar.txt +15 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/grammar/PEGGrammar.txt +11 -0
- package/SVF-linux-aarch64/Release-build/include/CFL/grammar/VFGGrammar.txt +7 -0
- package/SVF-linux-aarch64/Release-build/include/DDA/ContextDDA.h +230 -0
- package/SVF-linux-aarch64/Release-build/include/DDA/DDAClient.h +163 -0
- package/SVF-linux-aarch64/Release-build/include/DDA/DDAPass.h +102 -0
- package/SVF-linux-aarch64/Release-build/include/DDA/DDAStat.h +121 -0
- package/SVF-linux-aarch64/Release-build/include/DDA/DDAVFSolver.h +794 -0
- package/SVF-linux-aarch64/Release-build/include/DDA/FlowDDA.h +178 -0
- package/SVF-linux-aarch64/Release-build/include/FastCluster/LICENSE.TXT +13 -0
- package/SVF-linux-aarch64/Release-build/include/FastCluster/fastcluster.h +80 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/BasicBlockG.h +318 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/CDG.h +482 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/CFLGraph.h +232 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/CHG.h +369 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/CallGraph.h +498 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/ConsG.h +402 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/ConsGEdge.h +355 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/ConsGNode.h +418 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/DOTGraphTraits.h +188 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/GenericGraph.h +628 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/GraphPrinter.h +111 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/GraphTraits.h +150 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/GraphWriter.h +380 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/ICFG.h +331 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/ICFGEdge.h +281 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/ICFGNode.h +669 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/ICFGStat.h +164 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/IRGraph.h +398 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/SCC.h +375 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/SVFG.h +491 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/SVFGEdge.h +237 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/SVFGNode.h +501 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/SVFGOPT.h +363 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/SVFGStat.h +273 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/ThreadCallGraph.h +400 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/VFG.h +664 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/VFGEdge.h +295 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/VFGNode.h +1266 -0
- package/SVF-linux-aarch64/Release-build/include/Graphs/WTO.h +872 -0
- package/SVF-linux-aarch64/Release-build/include/MSSA/MSSAMuChi.h +722 -0
- package/SVF-linux-aarch64/Release-build/include/MSSA/MemPartition.h +169 -0
- package/SVF-linux-aarch64/Release-build/include/MSSA/MemRegion.h +489 -0
- package/SVF-linux-aarch64/Release-build/include/MSSA/MemSSA.h +452 -0
- package/SVF-linux-aarch64/Release-build/include/MSSA/SVFGBuilder.h +98 -0
- package/SVF-linux-aarch64/Release-build/include/MTA/LockAnalysis.h +533 -0
- package/SVF-linux-aarch64/Release-build/include/MTA/MHP.h +546 -0
- package/SVF-linux-aarch64/Release-build/include/MTA/MTA.h +98 -0
- package/SVF-linux-aarch64/Release-build/include/MTA/MTAStat.h +73 -0
- package/SVF-linux-aarch64/Release-build/include/MTA/TCT.h +620 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/AbstractPointsToDS.h +316 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/AccessPath.h +194 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/ConditionalPT.h +878 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/MutablePointsToDS.h +1025 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/PersistentPointsToCache.h +463 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/PersistentPointsToDS.h +955 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/PointerAnalysis.h +429 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/PointerAnalysisImpl.h +602 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/PointsTo.h +255 -0
- package/SVF-linux-aarch64/Release-build/include/MemoryModel/SVFLoop.h +167 -0
- package/SVF-linux-aarch64/Release-build/include/SABER/DoubleFreeChecker.h +76 -0
- package/SVF-linux-aarch64/Release-build/include/SABER/FileChecker.h +80 -0
- package/SVF-linux-aarch64/Release-build/include/SABER/LeakChecker.h +122 -0
- package/SVF-linux-aarch64/Release-build/include/SABER/ProgSlice.h +327 -0
- package/SVF-linux-aarch64/Release-build/include/SABER/SaberCheckerAPI.h +151 -0
- package/SVF-linux-aarch64/Release-build/include/SABER/SaberCondAllocator.h +317 -0
- package/SVF-linux-aarch64/Release-build/include/SABER/SaberSVFGBuilder.h +114 -0
- package/SVF-linux-aarch64/Release-build/include/SABER/SrcSnkDDA.h +327 -0
- package/SVF-linux-aarch64/Release-build/include/SABER/SrcSnkSolver.h +186 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/BasicTypes.h +280 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/BreakConstantExpr.h +94 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/CHGBuilder.h +78 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/CppUtil.h +184 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/DCHG.h +477 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/GEPTypeBridgeIterator.h +183 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/ICFGBuilder.h +160 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/LLVMLoopAnalysis.h +60 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/LLVMModule.h +594 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/LLVMUtil.h +438 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/ObjTypeInference.h +130 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/SVFIRBuilder.h +520 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/SVFLLVMValue.h +387 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/SVFModule.h +186 -0
- package/SVF-linux-aarch64/Release-build/include/SVF-LLVM/SymbolTableBuilder.h +132 -0
- package/SVF-linux-aarch64/Release-build/include/SVFIR/ObjTypeInfo.h +224 -0
- package/SVF-linux-aarch64/Release-build/include/SVFIR/PAGBuilderFromFile.h +80 -0
- package/SVF-linux-aarch64/Release-build/include/SVFIR/SVFIR.h +856 -0
- package/SVF-linux-aarch64/Release-build/include/SVFIR/SVFStatements.h +1328 -0
- package/SVF-linux-aarch64/Release-build/include/SVFIR/SVFType.h +578 -0
- package/SVF-linux-aarch64/Release-build/include/SVFIR/SVFValue.h +338 -0
- package/SVF-linux-aarch64/Release-build/include/SVFIR/SVFVariables.h +2204 -0
- package/SVF-linux-aarch64/Release-build/include/Util/Annotator.h +180 -0
- package/SVF-linux-aarch64/Release-build/include/Util/BitVector.h +55 -0
- package/SVF-linux-aarch64/Release-build/include/Util/CDGBuilder.h +107 -0
- package/SVF-linux-aarch64/Release-build/include/Util/CallGraphBuilder.h +62 -0
- package/SVF-linux-aarch64/Release-build/include/Util/Casting.h +426 -0
- package/SVF-linux-aarch64/Release-build/include/Util/CommandLine.h +530 -0
- package/SVF-linux-aarch64/Release-build/include/Util/CoreBitVector.h +214 -0
- package/SVF-linux-aarch64/Release-build/include/Util/CxtStmt.h +502 -0
- package/SVF-linux-aarch64/Release-build/include/Util/DPItem.h +618 -0
- package/SVF-linux-aarch64/Release-build/include/Util/ExtAPI.h +117 -0
- package/SVF-linux-aarch64/Release-build/include/Util/GeneralType.h +127 -0
- package/SVF-linux-aarch64/Release-build/include/Util/GraphReachSolver.h +186 -0
- package/SVF-linux-aarch64/Release-build/include/Util/NodeIDAllocator.h +203 -0
- package/SVF-linux-aarch64/Release-build/include/Util/Options.h +272 -0
- package/SVF-linux-aarch64/Release-build/include/Util/PTAStat.h +83 -0
- package/SVF-linux-aarch64/Release-build/include/Util/SVFBugReport.h +427 -0
- package/SVF-linux-aarch64/Release-build/include/Util/SVFLoopAndDomInfo.h +169 -0
- package/SVF-linux-aarch64/Release-build/include/Util/SVFStat.h +103 -0
- package/SVF-linux-aarch64/Release-build/include/Util/SVFUtil.h +478 -0
- package/SVF-linux-aarch64/Release-build/include/Util/SparseBitVector.h +1252 -0
- package/SVF-linux-aarch64/Release-build/include/Util/ThreadAPI.h +189 -0
- package/SVF-linux-aarch64/Release-build/include/Util/WorkList.h +317 -0
- package/SVF-linux-aarch64/Release-build/include/Util/Z3Expr.h +325 -0
- package/SVF-linux-aarch64/Release-build/include/Util/cJSON.h +300 -0
- package/SVF-linux-aarch64/Release-build/include/Util/config.h +26 -0
- package/SVF-linux-aarch64/Release-build/include/Util/iterator.h +407 -0
- package/SVF-linux-aarch64/Release-build/include/Util/iterator_range.h +76 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/Andersen.h +435 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/AndersenPWC.h +160 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/CSC.h +95 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/FlowSensitive.h +323 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/Steensgaard.h +131 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/TypeAnalysis.h +90 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/VersionedFlowSensitive.h +295 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/WPAFSSolver.h +246 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/WPAPass.h +116 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/WPASolver.h +205 -0
- package/SVF-linux-aarch64/Release-build/include/WPA/WPAStat.h +222 -0
- package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFConfig.cmake +58 -0
- package/SVF-linux-aarch64/Release-build/lib/cmake/SVF/SVFConfigVersion.cmake +43 -0
- package/SVF-linux-aarch64/Release-build/lib/extapi.bc +2449 -0
- package/SVF-linux-aarch64/Release-build/lib/libSvfCore.so +0 -0
- package/SVF-linux-aarch64/Release-build/lib/libSvfLLVM.so.16 +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
//===- BasicTypes.h -- Basic types used in SVF-------------------------------//
|
|
2
|
+
//
|
|
3
|
+
// SVF: Static Value-Flow Analysis
|
|
4
|
+
//
|
|
5
|
+
// Copyright (C) <2013-2017> <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
|
+
* BasicTypes.h
|
|
25
|
+
*
|
|
26
|
+
* Created on: Apr 1, 2014
|
|
27
|
+
* Author: Yulei Sui
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#ifndef INCLUDE_SVFLLVM_SVFVALUE_H_
|
|
31
|
+
#define INCLUDE_SVFLLVM_SVFVALUE_H_
|
|
32
|
+
|
|
33
|
+
#include "SVFIR/SVFType.h"
|
|
34
|
+
#include "Graphs/GraphPrinter.h"
|
|
35
|
+
#include "Util/Casting.h"
|
|
36
|
+
#include "Graphs/BasicBlockG.h"
|
|
37
|
+
#include "SVFIR/SVFValue.h"
|
|
38
|
+
#include "Util/SVFLoopAndDomInfo.h"
|
|
39
|
+
|
|
40
|
+
namespace SVF
|
|
41
|
+
{
|
|
42
|
+
|
|
43
|
+
/// LLVM Aliases and constants
|
|
44
|
+
typedef SVF::GraphPrinter GraphPrinter;
|
|
45
|
+
|
|
46
|
+
class CallGraphNode;
|
|
47
|
+
class SVFInstruction;
|
|
48
|
+
class SVFBasicBlock;
|
|
49
|
+
class SVFArgument;
|
|
50
|
+
class SVFFunction;
|
|
51
|
+
class SVFType;
|
|
52
|
+
|
|
53
|
+
class SVFLLVMValue
|
|
54
|
+
{
|
|
55
|
+
friend class SVFIRWriter;
|
|
56
|
+
friend class SVFIRReader;
|
|
57
|
+
friend class LLVMModuleSet;
|
|
58
|
+
|
|
59
|
+
public:
|
|
60
|
+
typedef s64_t GNodeK;
|
|
61
|
+
|
|
62
|
+
enum SVFValKind
|
|
63
|
+
{
|
|
64
|
+
SVFVal,
|
|
65
|
+
SVFFunc,
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
private:
|
|
69
|
+
GNodeK kind; ///< used for classof
|
|
70
|
+
bool ptrInUncalledFun; ///< true if this pointer is in an uncalled function
|
|
71
|
+
bool constDataOrAggData; ///< true if this value is a ConstantData (e.g., numbers, string, floats) or a constantAggregate
|
|
72
|
+
|
|
73
|
+
protected:
|
|
74
|
+
const SVFType* type; ///< Type of this SVFValue
|
|
75
|
+
std::string name; ///< Short name of value for printing & debugging
|
|
76
|
+
std::string sourceLoc; ///< Source code information of this value
|
|
77
|
+
/// Constructor without name
|
|
78
|
+
SVFLLVMValue(const SVFType* ty, SVFValKind k = SVFVal)
|
|
79
|
+
: kind(k), ptrInUncalledFun(false),
|
|
80
|
+
constDataOrAggData(false), type(ty), sourceLoc("NoLoc")
|
|
81
|
+
{
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
///@{ attributes to be set only through Module builders e.g.,
|
|
85
|
+
/// LLVMModule
|
|
86
|
+
inline void setConstDataOrAggData()
|
|
87
|
+
{
|
|
88
|
+
constDataOrAggData = true;
|
|
89
|
+
}
|
|
90
|
+
inline void setPtrInUncalledFunction()
|
|
91
|
+
{
|
|
92
|
+
ptrInUncalledFun = true;
|
|
93
|
+
}
|
|
94
|
+
///@}
|
|
95
|
+
public:
|
|
96
|
+
SVFLLVMValue() = delete;
|
|
97
|
+
virtual ~SVFLLVMValue() = default;
|
|
98
|
+
|
|
99
|
+
/// Get the type of this SVFValue
|
|
100
|
+
inline GNodeK getKind() const
|
|
101
|
+
{
|
|
102
|
+
return kind;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
inline const std::string &getName() const
|
|
106
|
+
{
|
|
107
|
+
return name;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
inline void setName(std::string&& n)
|
|
111
|
+
{
|
|
112
|
+
name = std::move(n);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
inline virtual const SVFType* getType() const
|
|
116
|
+
{
|
|
117
|
+
return type;
|
|
118
|
+
}
|
|
119
|
+
inline bool isConstDataOrAggData() const
|
|
120
|
+
{
|
|
121
|
+
return constDataOrAggData;
|
|
122
|
+
}
|
|
123
|
+
inline bool ptrInUncalledFunction() const
|
|
124
|
+
{
|
|
125
|
+
return ptrInUncalledFun;
|
|
126
|
+
}
|
|
127
|
+
inline virtual void setSourceLoc(const std::string& sourceCodeInfo)
|
|
128
|
+
{
|
|
129
|
+
sourceLoc = sourceCodeInfo;
|
|
130
|
+
}
|
|
131
|
+
inline virtual const std::string getSourceLoc() const
|
|
132
|
+
{
|
|
133
|
+
return sourceLoc;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/// Needs to be implemented by a SVF front end
|
|
137
|
+
std::string toString() const;
|
|
138
|
+
|
|
139
|
+
/// Overloading operator << for dumping ICFG node ID
|
|
140
|
+
//@{
|
|
141
|
+
friend OutStream& operator<<(OutStream &os, const SVFLLVMValue &value)
|
|
142
|
+
{
|
|
143
|
+
return os << value.toString();
|
|
144
|
+
}
|
|
145
|
+
//@}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
class ArgValVar;
|
|
149
|
+
|
|
150
|
+
class SVFFunction : public SVFLLVMValue
|
|
151
|
+
{
|
|
152
|
+
friend class LLVMModuleSet;
|
|
153
|
+
friend class SVFIRWriter;
|
|
154
|
+
friend class SVFIRReader;
|
|
155
|
+
friend class SVFIRBuilder;
|
|
156
|
+
|
|
157
|
+
public:
|
|
158
|
+
typename BasicBlockGraph::IDToNodeMapTy::iterator iterator;
|
|
159
|
+
typedef BasicBlockGraph::IDToNodeMapTy::const_iterator const_iterator;
|
|
160
|
+
typedef SVFLoopAndDomInfo::BBSet BBSet;
|
|
161
|
+
typedef SVFLoopAndDomInfo::BBList BBList;
|
|
162
|
+
typedef SVFLoopAndDomInfo::LoopBBs LoopBBs;
|
|
163
|
+
|
|
164
|
+
private:
|
|
165
|
+
bool isDecl; /// return true if this function does not have a body
|
|
166
|
+
bool intrinsic; /// return true if this function is an intrinsic function (e.g., llvm.dbg), which does not reside in the application code
|
|
167
|
+
bool addrTaken; /// return true if this function is address-taken (for indirect call purposes)
|
|
168
|
+
bool isUncalled; /// return true if this function is never called
|
|
169
|
+
bool isNotRet; /// return true if this function never returns
|
|
170
|
+
bool varArg; /// return true if this function supports variable arguments
|
|
171
|
+
const SVFFunctionType* funcType; /// FunctionType, which is different from the type (PointerType) of this SVFFunction
|
|
172
|
+
SVFLoopAndDomInfo* loopAndDom; /// the loop and dominate information
|
|
173
|
+
const SVFFunction* realDefFun; /// the definition of a function across multiple modules
|
|
174
|
+
std::vector<const ArgValVar*> allArgs; /// all formal arguments of this function
|
|
175
|
+
SVFBasicBlock *exitBlock; /// a 'single' basic block having no successors and containing return instruction in a function
|
|
176
|
+
BasicBlockGraph* bbGraph; /// the basic block graph of this function
|
|
177
|
+
|
|
178
|
+
protected:
|
|
179
|
+
|
|
180
|
+
inline void addArgument(const ArgValVar* arg)
|
|
181
|
+
{
|
|
182
|
+
allArgs.push_back(arg);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
inline void setIsUncalledFunction(bool uncalledFunction)
|
|
186
|
+
{
|
|
187
|
+
isUncalled = uncalledFunction;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
inline void setIsNotRet(bool notRet)
|
|
191
|
+
{
|
|
192
|
+
isNotRet = notRet;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
inline void setDefFunForMultipleModule(const SVFFunction* deffun)
|
|
196
|
+
{
|
|
197
|
+
realDefFun = deffun;
|
|
198
|
+
}
|
|
199
|
+
/// @}
|
|
200
|
+
|
|
201
|
+
public:
|
|
202
|
+
SVFFunction(const SVFType* ty,const SVFFunctionType* ft, bool declare, bool intrinsic, bool addrTaken, bool varg, SVFLoopAndDomInfo* ld);
|
|
203
|
+
SVFFunction(void) = delete;
|
|
204
|
+
virtual ~SVFFunction();
|
|
205
|
+
|
|
206
|
+
static inline bool classof(const SVFLLVMValue *node)
|
|
207
|
+
{
|
|
208
|
+
return node->getKind() == SVFFunc;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
inline SVFLoopAndDomInfo* getLoopAndDomInfo()
|
|
212
|
+
{
|
|
213
|
+
return loopAndDom;
|
|
214
|
+
}
|
|
215
|
+
inline bool isDeclaration() const
|
|
216
|
+
{
|
|
217
|
+
return isDecl;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
void setBasicBlockGraph(BasicBlockGraph* graph)
|
|
221
|
+
{
|
|
222
|
+
this->bbGraph = graph;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
BasicBlockGraph* getBasicBlockGraph()
|
|
226
|
+
{
|
|
227
|
+
return bbGraph;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const BasicBlockGraph* getBasicBlockGraph() const
|
|
231
|
+
{
|
|
232
|
+
return bbGraph;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
inline bool isIntrinsic() const
|
|
236
|
+
{
|
|
237
|
+
return intrinsic;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
inline bool hasAddressTaken() const
|
|
241
|
+
{
|
|
242
|
+
return addrTaken;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/// Returns the FunctionType
|
|
246
|
+
inline const SVFFunctionType* getFunctionType() const
|
|
247
|
+
{
|
|
248
|
+
return funcType;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/// Returns the FunctionType
|
|
252
|
+
inline const SVFType* getReturnType() const
|
|
253
|
+
{
|
|
254
|
+
return funcType->getReturnType();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
inline const SVFFunction* getDefFunForMultipleModule() const
|
|
258
|
+
{
|
|
259
|
+
if(realDefFun==nullptr)
|
|
260
|
+
return this;
|
|
261
|
+
return realDefFun;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
u32_t arg_size() const;
|
|
265
|
+
const ArgValVar* getArg(u32_t idx) const;
|
|
266
|
+
bool isVarArg() const;
|
|
267
|
+
|
|
268
|
+
inline bool hasBasicBlock() const
|
|
269
|
+
{
|
|
270
|
+
return bbGraph && bbGraph->begin() != bbGraph->end();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
inline const SVFBasicBlock* getEntryBlock() const
|
|
274
|
+
{
|
|
275
|
+
assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
|
|
276
|
+
assert(bbGraph->begin()->second->getInEdges().size() == 0 && "the first basic block is not entry block");
|
|
277
|
+
return bbGraph->begin()->second;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/// Carefully! when you call getExitBB, you need ensure the function has return instruction
|
|
281
|
+
/// more refer to: https://github.com/SVF-tools/SVF/pull/1262
|
|
282
|
+
const SVFBasicBlock* getExitBB() const;
|
|
283
|
+
|
|
284
|
+
void setExitBlock(SVFBasicBlock *bb);
|
|
285
|
+
|
|
286
|
+
inline const SVFBasicBlock* front() const
|
|
287
|
+
{
|
|
288
|
+
return getEntryBlock();
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
inline const SVFBasicBlock* back() const
|
|
292
|
+
{
|
|
293
|
+
assert(hasBasicBlock() && "function does not have any Basicblock, external function?");
|
|
294
|
+
/// Carefully! 'back' is just the last basic block of function,
|
|
295
|
+
/// but not necessarily a exit basic block
|
|
296
|
+
/// more refer to: https://github.com/SVF-tools/SVF/pull/1262
|
|
297
|
+
return std::prev(bbGraph->end())->second;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
inline const_iterator begin() const
|
|
301
|
+
{
|
|
302
|
+
return bbGraph->begin();
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
inline const_iterator end() const
|
|
306
|
+
{
|
|
307
|
+
return bbGraph->end();
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
inline const std::vector<const SVFBasicBlock*>& getReachableBBs() const
|
|
312
|
+
{
|
|
313
|
+
return loopAndDom->getReachableBBs();
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
inline bool isUncalledFunction() const
|
|
317
|
+
{
|
|
318
|
+
return isUncalled;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
inline bool hasReturn() const
|
|
322
|
+
{
|
|
323
|
+
return !isNotRet;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
inline void getExitBlocksOfLoop(const SVFBasicBlock* bb, BBList& exitbbs) const
|
|
327
|
+
{
|
|
328
|
+
return loopAndDom->getExitBlocksOfLoop(bb,exitbbs);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
inline bool hasLoopInfo(const SVFBasicBlock* bb) const
|
|
332
|
+
{
|
|
333
|
+
return loopAndDom->hasLoopInfo(bb);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const LoopBBs& getLoopInfo(const SVFBasicBlock* bb) const
|
|
337
|
+
{
|
|
338
|
+
return loopAndDom->getLoopInfo(bb);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
inline const SVFBasicBlock* getLoopHeader(const BBList& lp) const
|
|
342
|
+
{
|
|
343
|
+
return loopAndDom->getLoopHeader(lp);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
inline bool loopContainsBB(const BBList& lp, const SVFBasicBlock* bb) const
|
|
347
|
+
{
|
|
348
|
+
return loopAndDom->loopContainsBB(lp,bb);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
inline const Map<const SVFBasicBlock*,BBSet>& getDomTreeMap() const
|
|
352
|
+
{
|
|
353
|
+
return loopAndDom->getDomTreeMap();
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
inline const Map<const SVFBasicBlock*,BBSet>& getDomFrontierMap() const
|
|
357
|
+
{
|
|
358
|
+
return loopAndDom->getDomFrontierMap();
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
inline bool isLoopHeader(const SVFBasicBlock* bb) const
|
|
362
|
+
{
|
|
363
|
+
return loopAndDom->isLoopHeader(bb);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
inline bool dominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
|
|
367
|
+
{
|
|
368
|
+
return loopAndDom->dominate(bbKey,bbValue);
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
inline bool postDominate(const SVFBasicBlock* bbKey, const SVFBasicBlock* bbValue) const
|
|
372
|
+
{
|
|
373
|
+
return loopAndDom->postDominate(bbKey,bbValue);
|
|
374
|
+
}
|
|
375
|
+
};
|
|
376
|
+
|
|
377
|
+
/// [FOR DEBUG ONLY, DON'T USE IT UNSIDE `svf`!]
|
|
378
|
+
/// Converts an SVFValue to corresponding LLVM::Value, then get the string
|
|
379
|
+
/// representation of it. Use it only when you are debugging. Don't use
|
|
380
|
+
/// it in any SVF algorithm because it relies on information stored in LLVM bc.
|
|
381
|
+
std::string dumpLLVMValue(const SVFLLVMValue* svfValue);
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
} // End namespace SVF
|
|
386
|
+
|
|
387
|
+
#endif /* INCLUDE_SVFLLVM_SVFVALUE_H_ */
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
//===- SVFModule.h -- SVFModule* class----------------------------------------//
|
|
2
|
+
//
|
|
3
|
+
// SVF: Static Value-Flow Analysis
|
|
4
|
+
//
|
|
5
|
+
// Copyright (C) <2013-2017> <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
|
+
* SVFModule.h
|
|
25
|
+
*
|
|
26
|
+
* Created on: Aug 4, 2017
|
|
27
|
+
* Author: Xiaokang Fan
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#ifndef INCLUDE_SVFMODULE_H_
|
|
31
|
+
#define INCLUDE_SVFMODULE_H_
|
|
32
|
+
|
|
33
|
+
#include "SVF-LLVM/SVFLLVMValue.h"
|
|
34
|
+
#include "Util/NodeIDAllocator.h"
|
|
35
|
+
#include "Util/ThreadAPI.h"
|
|
36
|
+
|
|
37
|
+
namespace SVF
|
|
38
|
+
{
|
|
39
|
+
|
|
40
|
+
class SVFModule
|
|
41
|
+
{
|
|
42
|
+
friend class SVFIRWriter;
|
|
43
|
+
friend class SVFIRReader;
|
|
44
|
+
|
|
45
|
+
public:
|
|
46
|
+
typedef std::vector<const SVFFunction*> FunctionSetType;
|
|
47
|
+
typedef std::vector<SVFLLVMValue*> GlobalSetType;
|
|
48
|
+
typedef std::vector<SVFLLVMValue*> AliasSetType;
|
|
49
|
+
typedef std::vector<SVFLLVMValue*> ConstantType;
|
|
50
|
+
typedef std::vector<SVFLLVMValue*> OtherValueType;
|
|
51
|
+
|
|
52
|
+
/// Iterators type def
|
|
53
|
+
typedef FunctionSetType::iterator iterator;
|
|
54
|
+
typedef FunctionSetType::const_iterator const_iterator;
|
|
55
|
+
typedef GlobalSetType::iterator global_iterator;
|
|
56
|
+
typedef GlobalSetType::const_iterator const_global_iterator;
|
|
57
|
+
typedef AliasSetType::iterator alias_iterator;
|
|
58
|
+
typedef AliasSetType::const_iterator const_alias_iterator;
|
|
59
|
+
typedef ConstantType::iterator cdata_iterator;
|
|
60
|
+
typedef ConstantType::const_iterator const_cdata_iterator;
|
|
61
|
+
typedef OtherValueType::iterator ovalue_iterator;
|
|
62
|
+
typedef OtherValueType::const_iterator const_ovalue_iterator;
|
|
63
|
+
|
|
64
|
+
private:
|
|
65
|
+
static SVFModule* svfModule;
|
|
66
|
+
FunctionSetType FunctionSet; ///< The Functions in the module
|
|
67
|
+
GlobalSetType GlobalSet; ///< The Global Variables in the module
|
|
68
|
+
AliasSetType AliasSet; ///< The Aliases in the module
|
|
69
|
+
ConstantType ConstantSet; ///< The ConstantData in the module
|
|
70
|
+
OtherValueType OtherValueSet; ///< All other values in the module
|
|
71
|
+
|
|
72
|
+
/// Constructors
|
|
73
|
+
SVFModule() = default;
|
|
74
|
+
|
|
75
|
+
public:
|
|
76
|
+
static SVFModule* getSVFModule();
|
|
77
|
+
static void releaseSVFModule();
|
|
78
|
+
|
|
79
|
+
~SVFModule();
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
const SVFFunction* getSVFFunction(const std::string& name);
|
|
83
|
+
|
|
84
|
+
///@{
|
|
85
|
+
inline void addFunctionSet(SVFFunction* svfFunc)
|
|
86
|
+
{
|
|
87
|
+
FunctionSet.push_back(svfFunc);
|
|
88
|
+
}
|
|
89
|
+
inline void addGlobalSet(SVFLLVMValue* glob)
|
|
90
|
+
{
|
|
91
|
+
GlobalSet.push_back(glob);
|
|
92
|
+
}
|
|
93
|
+
inline void addAliasSet(SVFLLVMValue* alias)
|
|
94
|
+
{
|
|
95
|
+
AliasSet.push_back(alias);
|
|
96
|
+
}
|
|
97
|
+
inline void addConstant(SVFLLVMValue* cd)
|
|
98
|
+
{
|
|
99
|
+
ConstantSet.push_back(cd);
|
|
100
|
+
}
|
|
101
|
+
inline void addOtherValue(SVFLLVMValue* ov)
|
|
102
|
+
{
|
|
103
|
+
OtherValueSet.push_back(ov);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
///@}
|
|
107
|
+
|
|
108
|
+
/// Iterators
|
|
109
|
+
///@{
|
|
110
|
+
global_iterator global_begin()
|
|
111
|
+
{
|
|
112
|
+
return GlobalSet.begin();
|
|
113
|
+
}
|
|
114
|
+
const_global_iterator global_begin() const
|
|
115
|
+
{
|
|
116
|
+
return GlobalSet.begin();
|
|
117
|
+
}
|
|
118
|
+
global_iterator global_end()
|
|
119
|
+
{
|
|
120
|
+
return GlobalSet.end();
|
|
121
|
+
}
|
|
122
|
+
const_global_iterator global_end() const
|
|
123
|
+
{
|
|
124
|
+
return GlobalSet.end();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
alias_iterator alias_begin()
|
|
128
|
+
{
|
|
129
|
+
return AliasSet.begin();
|
|
130
|
+
}
|
|
131
|
+
const_alias_iterator alias_begin() const
|
|
132
|
+
{
|
|
133
|
+
return AliasSet.begin();
|
|
134
|
+
}
|
|
135
|
+
alias_iterator alias_end()
|
|
136
|
+
{
|
|
137
|
+
return AliasSet.end();
|
|
138
|
+
}
|
|
139
|
+
const_alias_iterator alias_end() const
|
|
140
|
+
{
|
|
141
|
+
return AliasSet.end();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
cdata_iterator constant_begin()
|
|
145
|
+
{
|
|
146
|
+
return ConstantSet.begin();
|
|
147
|
+
}
|
|
148
|
+
const_cdata_iterator constant_begin() const
|
|
149
|
+
{
|
|
150
|
+
return ConstantSet.begin();
|
|
151
|
+
}
|
|
152
|
+
cdata_iterator constant_end()
|
|
153
|
+
{
|
|
154
|
+
return ConstantSet.end();
|
|
155
|
+
}
|
|
156
|
+
const_cdata_iterator constant_end() const
|
|
157
|
+
{
|
|
158
|
+
return ConstantSet.end();
|
|
159
|
+
}
|
|
160
|
+
///@}
|
|
161
|
+
|
|
162
|
+
inline const FunctionSetType& getFunctionSet() const
|
|
163
|
+
{
|
|
164
|
+
return FunctionSet;
|
|
165
|
+
}
|
|
166
|
+
inline const ConstantType& getConstantSet() const
|
|
167
|
+
{
|
|
168
|
+
return ConstantSet;
|
|
169
|
+
}
|
|
170
|
+
inline const GlobalSetType& getGlobalSet() const
|
|
171
|
+
{
|
|
172
|
+
return GlobalSet;
|
|
173
|
+
}
|
|
174
|
+
inline const AliasSetType& getAliasSet() const
|
|
175
|
+
{
|
|
176
|
+
return AliasSet;
|
|
177
|
+
}
|
|
178
|
+
inline const OtherValueType& getOtherValueSet() const
|
|
179
|
+
{
|
|
180
|
+
return OtherValueSet;
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
} // End namespace SVF
|
|
185
|
+
|
|
186
|
+
#endif /* INCLUDE_SVFMODULE_H_ */
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
//===- SymbolTableBuilder.h -- Symbol Table builder-----------------------//
|
|
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
|
+
* SymbolTableBuilder.h
|
|
25
|
+
*
|
|
26
|
+
* Created on: Apr 28, 2014
|
|
27
|
+
* Author: Yulei
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
#ifndef SymbolTableBuilder_H_
|
|
31
|
+
#define SymbolTableBuilder_H_
|
|
32
|
+
|
|
33
|
+
#include "SVF-LLVM/LLVMModule.h"
|
|
34
|
+
#include "SVFIR/ObjTypeInfo.h"
|
|
35
|
+
|
|
36
|
+
/*
|
|
37
|
+
* This class is to build SymbolTableInfo, MemObjs and ObjTypeInfo
|
|
38
|
+
*/
|
|
39
|
+
namespace SVF
|
|
40
|
+
{
|
|
41
|
+
|
|
42
|
+
class ObjTypeInference;
|
|
43
|
+
|
|
44
|
+
class SymbolTableBuilder
|
|
45
|
+
{
|
|
46
|
+
friend class SVFIRBuilder;
|
|
47
|
+
private:
|
|
48
|
+
SVFIR* svfir;
|
|
49
|
+
|
|
50
|
+
public:
|
|
51
|
+
/// Constructor
|
|
52
|
+
SymbolTableBuilder(SVFIR* ir): svfir(ir)
|
|
53
|
+
{
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/// Start building memory model
|
|
57
|
+
void buildMemModel(SVFModule* svfModule);
|
|
58
|
+
|
|
59
|
+
/// Return size of this object based on LLVM value
|
|
60
|
+
u32_t getNumOfElements(const Type* ety);
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
protected:
|
|
64
|
+
|
|
65
|
+
/// collect the syms
|
|
66
|
+
//@{
|
|
67
|
+
void collectSVFTypeInfo(const Value* val);
|
|
68
|
+
|
|
69
|
+
void collectSym(const Value* val);
|
|
70
|
+
|
|
71
|
+
void collectVal(const Value* val);
|
|
72
|
+
|
|
73
|
+
void collectObj(const Value* val);
|
|
74
|
+
|
|
75
|
+
void collectRet(const Function* val);
|
|
76
|
+
|
|
77
|
+
void collectVararg(const Function* val);
|
|
78
|
+
//@}
|
|
79
|
+
|
|
80
|
+
/// Handle constant expression
|
|
81
|
+
// @{
|
|
82
|
+
void handleGlobalCE(const GlobalVariable *G);
|
|
83
|
+
void handleGlobalInitializerCE(const Constant *C);
|
|
84
|
+
void handleCE(const Value* val);
|
|
85
|
+
// @}
|
|
86
|
+
|
|
87
|
+
inline LLVMModuleSet* llvmModuleSet()
|
|
88
|
+
{
|
|
89
|
+
return LLVMModuleSet::getLLVMModuleSet();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
ObjTypeInference* getTypeInference();
|
|
93
|
+
|
|
94
|
+
/// Forward collect all possible infer sites starting from a value
|
|
95
|
+
const Type* inferObjType(const Value *startValue);
|
|
96
|
+
|
|
97
|
+
/// Get the reference type of heap/static object from an allocation site.
|
|
98
|
+
//@{
|
|
99
|
+
const Type *inferTypeOfHeapObjOrStaticObj(const Instruction* inst);
|
|
100
|
+
//@}
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
/// Create an objectInfo based on LLVM value
|
|
104
|
+
ObjTypeInfo* createObjTypeInfo(const Value* val);
|
|
105
|
+
|
|
106
|
+
/// Initialize TypeInfo based on LLVM Value
|
|
107
|
+
void initTypeInfo(ObjTypeInfo* typeinfo, const Value* value, const Type* ty);
|
|
108
|
+
/// Analyse types of all flattened fields of this object
|
|
109
|
+
void analyzeObjType(ObjTypeInfo* typeinfo, const Value* val);
|
|
110
|
+
/// Analyse types of heap and static objects
|
|
111
|
+
u32_t analyzeHeapObjType(ObjTypeInfo* typeinfo, const Value* val);
|
|
112
|
+
/// Analyse types of heap and static objects
|
|
113
|
+
void analyzeStaticObjType(ObjTypeInfo* typeinfo, const Value* val);
|
|
114
|
+
|
|
115
|
+
/// Analyze byte size of heap alloc function (e.g. malloc/calloc/...)
|
|
116
|
+
u32_t analyzeHeapAllocByteSize(const Value* val);
|
|
117
|
+
|
|
118
|
+
///Get a reference to the components of struct_info.
|
|
119
|
+
/// Number of flattened elements of an array or struct
|
|
120
|
+
u32_t getNumOfFlattenElements(const Type* T);
|
|
121
|
+
|
|
122
|
+
///Get a reference to StructInfo.
|
|
123
|
+
StInfo* getOrAddSVFTypeInfo(const Type* T);
|
|
124
|
+
|
|
125
|
+
ObjTypeInfo* createBlkObjTypeInfo(NodeID symId);
|
|
126
|
+
|
|
127
|
+
ObjTypeInfo* createConstantObjTypeInfo(NodeID symId);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
} // End namespace SVF
|
|
131
|
+
|
|
132
|
+
#endif /* SymbolTableBuilder_H_ */
|