svf-lib 1.0.1630 → 1.0.1632
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/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-linux/svf-llvm/include/SVF-LLVM/LLVMModule.h +16 -4
- package/SVF-osx/Release-build/svf/libSvfCore.a +0 -0
- package/SVF-osx/Release-build/svf-llvm/libSvfLLVM.a +0 -0
- package/SVF-osx/svf-llvm/include/SVF-LLVM/LLVMModule.h +16 -4
- package/package.json +1 -1
|
Binary file
|
|
@@ -237,14 +237,26 @@ public:
|
|
|
237
237
|
SVFOtherValue* getSVFOtherValue(const Value* ov);
|
|
238
238
|
|
|
239
239
|
/// Remove unused function in extapi.bc module
|
|
240
|
-
bool
|
|
240
|
+
bool isCalledExtFunction(Function* func)
|
|
241
241
|
{
|
|
242
|
+
/// check if a llvm Function is called.
|
|
243
|
+
auto isCalledFunction = [](llvm::Function* F)
|
|
244
|
+
{
|
|
245
|
+
for (auto& use : F->uses())
|
|
246
|
+
{
|
|
247
|
+
llvm::User* user = use.getUser();
|
|
248
|
+
|
|
249
|
+
if (llvm::isa<llvm::CallBase>(user))
|
|
250
|
+
{
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return false;
|
|
255
|
+
};
|
|
242
256
|
/// if this function func defined in extapi.bc but never used in application code (without any corresponding declared functions).
|
|
243
257
|
if (func->getParent()->getName().str() == Options::ExtAPIInput()
|
|
258
|
+
&& !isCalledFunction(func)
|
|
244
259
|
&& func->getName().str() != "svf__main"
|
|
245
|
-
&& func->getName().str() != "malloc"
|
|
246
|
-
&& func->getName().str() != "main"
|
|
247
|
-
&& func->getName().substr(0,4) != "sse_"
|
|
248
260
|
&& FunDefToDeclsMap.find(func) == FunDefToDeclsMap.end()
|
|
249
261
|
&& std::find(ExtFuncsVec.begin(), ExtFuncsVec.end(), func) == ExtFuncsVec.end())
|
|
250
262
|
{
|
|
Binary file
|
|
Binary file
|
|
@@ -237,14 +237,26 @@ public:
|
|
|
237
237
|
SVFOtherValue* getSVFOtherValue(const Value* ov);
|
|
238
238
|
|
|
239
239
|
/// Remove unused function in extapi.bc module
|
|
240
|
-
bool
|
|
240
|
+
bool isCalledExtFunction(Function* func)
|
|
241
241
|
{
|
|
242
|
+
/// check if a llvm Function is called.
|
|
243
|
+
auto isCalledFunction = [](llvm::Function* F)
|
|
244
|
+
{
|
|
245
|
+
for (auto& use : F->uses())
|
|
246
|
+
{
|
|
247
|
+
llvm::User* user = use.getUser();
|
|
248
|
+
|
|
249
|
+
if (llvm::isa<llvm::CallBase>(user))
|
|
250
|
+
{
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return false;
|
|
255
|
+
};
|
|
242
256
|
/// if this function func defined in extapi.bc but never used in application code (without any corresponding declared functions).
|
|
243
257
|
if (func->getParent()->getName().str() == Options::ExtAPIInput()
|
|
258
|
+
&& !isCalledFunction(func)
|
|
244
259
|
&& func->getName().str() != "svf__main"
|
|
245
|
-
&& func->getName().str() != "malloc"
|
|
246
|
-
&& func->getName().str() != "main"
|
|
247
|
-
&& func->getName().substr(0,4) != "sse_"
|
|
248
260
|
&& FunDefToDeclsMap.find(func) == FunDefToDeclsMap.end()
|
|
249
261
|
&& std::find(ExtFuncsVec.begin(), ExtFuncsVec.end(), func) == ExtFuncsVec.end())
|
|
250
262
|
{
|