svf-lib 1.0.1769 → 1.0.1771

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.
@@ -132,36 +132,7 @@ Type *getPointeeType(const Value *value);
132
132
 
133
133
  /// Get the reference type of heap/static object from an allocation site.
134
134
  //@{
135
- inline const PointerType *getRefTypeOfHeapAllocOrStatic(const CallBase* cs)
136
- {
137
- const PointerType *refType = nullptr;
138
- const SVFInstruction* svfcall = LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(cs);
139
- CallSite svfcs = SVFUtil::getSVFCallSite(svfcall);
140
- // Case 1: heap object held by *argument, we should get its element type.
141
- if (SVFUtil::isHeapAllocExtCallViaArg(svfcs))
142
- {
143
- int argPos = SVFUtil::getHeapAllocHoldingArgPosition(svfcs);
144
- const Value* arg = cs->getArgOperand(argPos);
145
- if (const PointerType *argType = SVFUtil::dyn_cast<PointerType>(arg->getType()))
146
- // TODO: getPtrElementType need type inference
147
- refType = SVFUtil::dyn_cast<PointerType>(getPtrElementType(argType));
148
- }
149
- // Case 2: heap object held by return value.
150
- else
151
- {
152
- assert(SVFUtil::isHeapAllocExtCallViaRet(svfcs)
153
- && "Must be heap alloc via ret, or static allocation site");
154
- refType = SVFUtil::dyn_cast<PointerType>(cs->getType());
155
- }
156
- assert(refType && "Allocated object must be held by a pointer-typed value.");
157
- return refType;
158
- }
159
-
160
- inline const PointerType *getRefTypeOfHeapAllocOrStatic(const Instruction* inst)
161
- {
162
- const CallBase* cs = getLLVMCallSite(inst);
163
- return getRefTypeOfHeapAllocOrStatic(cs);
164
- }
135
+ const Type *inferTypeOfHeapObjOrStaticObj(const Instruction* inst);
165
136
  //@}
166
137
 
167
138
  /// Return true if this value refers to a object
@@ -227,9 +198,6 @@ const Value* stripConstantCasts(const Value* val);
227
198
  /// Strip off the all casts
228
199
  const Value* stripAllCasts(const Value* val);
229
200
 
230
- /// Get the type of the heap allocation
231
- const Type* getTypeOfHeapAlloc(const Instruction* inst);
232
-
233
201
  /// Return the bitcast instruction right next to val, otherwise
234
202
  /// return nullptr
235
203
  const Value* getFirstUseViaCastInst(const Value* val);
@@ -132,36 +132,7 @@ Type *getPointeeType(const Value *value);
132
132
 
133
133
  /// Get the reference type of heap/static object from an allocation site.
134
134
  //@{
135
- inline const PointerType *getRefTypeOfHeapAllocOrStatic(const CallBase* cs)
136
- {
137
- const PointerType *refType = nullptr;
138
- const SVFInstruction* svfcall = LLVMModuleSet::getLLVMModuleSet()->getSVFInstruction(cs);
139
- CallSite svfcs = SVFUtil::getSVFCallSite(svfcall);
140
- // Case 1: heap object held by *argument, we should get its element type.
141
- if (SVFUtil::isHeapAllocExtCallViaArg(svfcs))
142
- {
143
- int argPos = SVFUtil::getHeapAllocHoldingArgPosition(svfcs);
144
- const Value* arg = cs->getArgOperand(argPos);
145
- if (const PointerType *argType = SVFUtil::dyn_cast<PointerType>(arg->getType()))
146
- // TODO: getPtrElementType need type inference
147
- refType = SVFUtil::dyn_cast<PointerType>(getPtrElementType(argType));
148
- }
149
- // Case 2: heap object held by return value.
150
- else
151
- {
152
- assert(SVFUtil::isHeapAllocExtCallViaRet(svfcs)
153
- && "Must be heap alloc via ret, or static allocation site");
154
- refType = SVFUtil::dyn_cast<PointerType>(cs->getType());
155
- }
156
- assert(refType && "Allocated object must be held by a pointer-typed value.");
157
- return refType;
158
- }
159
-
160
- inline const PointerType *getRefTypeOfHeapAllocOrStatic(const Instruction* inst)
161
- {
162
- const CallBase* cs = getLLVMCallSite(inst);
163
- return getRefTypeOfHeapAllocOrStatic(cs);
164
- }
135
+ const Type *inferTypeOfHeapObjOrStaticObj(const Instruction* inst);
165
136
  //@}
166
137
 
167
138
  /// Return true if this value refers to a object
@@ -227,9 +198,6 @@ const Value* stripConstantCasts(const Value* val);
227
198
  /// Strip off the all casts
228
199
  const Value* stripAllCasts(const Value* val);
229
200
 
230
- /// Get the type of the heap allocation
231
- const Type* getTypeOfHeapAlloc(const Instruction* inst);
232
-
233
201
  /// Return the bitcast instruction right next to val, otherwise
234
202
  /// return nullptr
235
203
  const Value* getFirstUseViaCastInst(const Value* val);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1769",
3
+ "version": "1.0.1771",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {