svf-lib 1.0.848 → 1.0.849
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/Release-build/lib/libSvf.a +0 -0
- package/SVF-linux/include/MemoryModel/SVFIR.h +1 -1
- package/SVF-linux/include/MemoryModel/SVFVariables.h +2 -8
- package/SVF-linux/include/MemoryModel/SymbolTableInfo.h +2 -6
- package/SVF-linux/include/SVF-FE/SVFIRBuilder.h +34 -35
- package/SVF-linux/include/SVF-FE/SymbolTableBuilder.h +1 -1
- package/SVF-linux/include/Util/Options.h +1 -0
- package/package.json +1 -1
|
Binary file
|
|
@@ -553,7 +553,7 @@ private:
|
|
|
553
553
|
}
|
|
554
554
|
|
|
555
555
|
/// Add a temp field value node, this method can only invoked by getGepValVar
|
|
556
|
-
NodeID addGepValNode(const Value* curInst,const Value* val, const LocationSet& ls, NodeID i, const Type *type
|
|
556
|
+
NodeID addGepValNode(const Value* curInst,const Value* val, const LocationSet& ls, NodeID i, const Type *type);
|
|
557
557
|
/// Add a field obj node, this method can only invoked by getGepObjVar
|
|
558
558
|
NodeID addGepObjNode(const MemObj* obj, const LocationSet& ls);
|
|
559
559
|
/// Add a field-insensitive node, this method can only invoked by getFIGepObjNode
|
|
@@ -395,7 +395,6 @@ class GepValVar: public ValVar
|
|
|
395
395
|
private:
|
|
396
396
|
LocationSet ls; // LocationSet
|
|
397
397
|
const Type *gepValType;
|
|
398
|
-
u32_t fieldIdx;
|
|
399
398
|
|
|
400
399
|
public:
|
|
401
400
|
/// Methods for support type inquiry through isa, cast, and dyn_cast:
|
|
@@ -419,8 +418,8 @@ public:
|
|
|
419
418
|
//@}
|
|
420
419
|
|
|
421
420
|
/// Constructor
|
|
422
|
-
GepValVar(const Value* val, NodeID i, const LocationSet& l, const Type *ty
|
|
423
|
-
ValVar(val, i, GepValNode), ls(l), gepValType(ty)
|
|
421
|
+
GepValVar(const Value* val, NodeID i, const LocationSet& l, const Type *ty) :
|
|
422
|
+
ValVar(val, i, GepValNode), ls(l), gepValType(ty)
|
|
424
423
|
{
|
|
425
424
|
}
|
|
426
425
|
|
|
@@ -443,11 +442,6 @@ public:
|
|
|
443
442
|
return gepValType;
|
|
444
443
|
}
|
|
445
444
|
|
|
446
|
-
u32_t getFieldIdx() const
|
|
447
|
-
{
|
|
448
|
-
return fieldIdx;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
445
|
virtual const std::string toString() const;
|
|
452
446
|
};
|
|
453
447
|
|
|
@@ -354,13 +354,9 @@ public:
|
|
|
354
354
|
|
|
355
355
|
///Get a reference to the components of struct_info.
|
|
356
356
|
/// Number of flattenned elements of an array or struct
|
|
357
|
-
|
|
358
|
-
/// Number of flattenned fields of a struct
|
|
359
|
-
const u32_t getNumOfFlattenFields(const StructType *T);
|
|
357
|
+
u32_t getNumOfFlattenElements(const Type *T);
|
|
360
358
|
/// Flatterned element idx of an array or struct by considering stride
|
|
361
|
-
|
|
362
|
-
/// Flatterned field index information of a struct ignoring any array field
|
|
363
|
-
const std::vector<u32_t>& getFlattenedFieldIdxVec(const Type *T);
|
|
359
|
+
u32_t getFlattenedElemIdx(const Type *T, s64_t origId);
|
|
364
360
|
|
|
365
361
|
const std::vector<FlattenedFieldInfo>& getFlattenedFieldInfoVec(const Type *T);
|
|
366
362
|
|
|
@@ -109,41 +109,9 @@ public:
|
|
|
109
109
|
return pag->getVarargNode(func);
|
|
110
110
|
}
|
|
111
111
|
//@}
|
|
112
|
-
|
|
113
|
-
/// Handle globals including (global variable and functions)
|
|
114
|
-
//@{
|
|
115
|
-
void visitGlobal(SVFModule* svfModule);
|
|
116
|
-
void InitialGlobal(const GlobalVariable *gvar, Constant *C,
|
|
117
|
-
u32_t offset);
|
|
118
|
-
NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset);
|
|
119
|
-
//@}
|
|
120
|
-
|
|
121
|
-
/// Process constant expression
|
|
122
|
-
void processCE(const Value *val);
|
|
123
|
-
|
|
124
|
-
/// Infer field index from byteoffset.
|
|
125
|
-
u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s64_t idx);
|
|
126
|
-
|
|
127
|
-
/// Compute offset of a gep instruction or gep constant expression
|
|
128
|
-
bool computeGepOffset(const User *V, LocationSet& ls);
|
|
129
|
-
|
|
130
|
-
/// Get the base type and max offset
|
|
131
|
-
const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields, const Value* sz);
|
|
132
|
-
|
|
133
|
-
/// Handle direct call
|
|
134
|
-
void handleDirectCall(CallSite cs, const SVFFunction *F);
|
|
135
|
-
|
|
136
|
-
/// Handle indirect call
|
|
137
|
-
void handleIndCall(CallSite cs);
|
|
138
|
-
|
|
139
112
|
/// Update SVFIR given a call graph (creating new CallPE and RetPE for resolved indirect calls)
|
|
140
113
|
void updateCallGraph(PTACallGraph* callgraph);
|
|
141
114
|
|
|
142
|
-
/// Handle external call
|
|
143
|
-
//@{
|
|
144
|
-
virtual void handleExtCall(CallSite cs, const SVFFunction *F);
|
|
145
|
-
void addComplexConsForExt(Value *D, Value *S, const Value* sz);
|
|
146
|
-
//@}
|
|
147
115
|
|
|
148
116
|
/// Our visit overrides.
|
|
149
117
|
//@{
|
|
@@ -238,6 +206,39 @@ public:
|
|
|
238
206
|
}
|
|
239
207
|
//}@
|
|
240
208
|
|
|
209
|
+
protected:
|
|
210
|
+
/// Handle globals including (global variable and functions)
|
|
211
|
+
//@{
|
|
212
|
+
void visitGlobal(SVFModule* svfModule);
|
|
213
|
+
void InitialGlobal(const GlobalVariable *gvar, Constant *C,
|
|
214
|
+
u32_t offset);
|
|
215
|
+
NodeID getGlobalVarField(const GlobalVariable *gvar, u32_t offset);
|
|
216
|
+
//@}
|
|
217
|
+
|
|
218
|
+
/// Process constant expression
|
|
219
|
+
void processCE(const Value *val);
|
|
220
|
+
|
|
221
|
+
/// Infer field index from byteoffset.
|
|
222
|
+
u32_t inferFieldIdxFromByteOffset(const llvm::GEPOperator* gepOp, DataLayout *dl, LocationSet& ls, s64_t idx);
|
|
223
|
+
|
|
224
|
+
/// Compute offset of a gep instruction or gep constant expression
|
|
225
|
+
bool computeGepOffset(const User *V, LocationSet& ls);
|
|
226
|
+
|
|
227
|
+
/// Get the base type and max offset
|
|
228
|
+
const Type *getBaseTypeAndFlattenedFields(const Value *V, std::vector<LocationSet> &fields, const Value* sz);
|
|
229
|
+
|
|
230
|
+
/// Handle direct call
|
|
231
|
+
void handleDirectCall(CallSite cs, const SVFFunction *F);
|
|
232
|
+
|
|
233
|
+
/// Handle indirect call
|
|
234
|
+
void handleIndCall(CallSite cs);
|
|
235
|
+
|
|
236
|
+
/// Handle external call
|
|
237
|
+
//@{
|
|
238
|
+
virtual void handleExtCall(CallSite cs, const SVFFunction *F);
|
|
239
|
+
void addComplexConsForExt(Value *D, Value *S, const Value* sz);
|
|
240
|
+
//@}
|
|
241
|
+
|
|
241
242
|
/// Set current basic block in order to keep track of control flow information
|
|
242
243
|
inline void setCurrentLocation(const Value* val, const BasicBlock* bb)
|
|
243
244
|
{
|
|
@@ -275,9 +276,7 @@ public:
|
|
|
275
276
|
return nullPtr;
|
|
276
277
|
}
|
|
277
278
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
NodeID getGepValVar(const Value* val, const LocationSet& ls, const Type *baseType, u32_t fieldidx);
|
|
279
|
+
NodeID getGepValVar(const Value* val, const LocationSet& ls, const Type *baseType);
|
|
281
280
|
|
|
282
281
|
void setCurrentBBAndValueForPAGEdge(PAGEdge* edge);
|
|
283
282
|
|
|
@@ -69,7 +69,7 @@ public:
|
|
|
69
69
|
/// Handle constant expression
|
|
70
70
|
// @{
|
|
71
71
|
void handleGlobalCE(const GlobalVariable *G);
|
|
72
|
-
void handleGlobalInitializerCE(const Constant *C
|
|
72
|
+
void handleGlobalInitializerCE(const Constant *C);
|
|
73
73
|
void handleCE(const Value *val);
|
|
74
74
|
// @}
|
|
75
75
|
|
|
@@ -211,6 +211,7 @@ public:
|
|
|
211
211
|
// SymbolTableInfo.cpp
|
|
212
212
|
static const llvm::cl::opt<bool> LocMemModel;
|
|
213
213
|
static const llvm::cl::opt<bool> ModelConsts;
|
|
214
|
+
static const llvm::cl::opt<bool> ModelArrays;
|
|
214
215
|
static const llvm::cl::opt<bool> SymTabPrint;
|
|
215
216
|
|
|
216
217
|
// Conditions.cpp
|