svf-tools 1.0.1180 → 1.0.1182
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/build.sh +7 -7
- package/package.json +1 -1
- package/svf-llvm/CMakeLists.txt +16 -1
- package/svf-llvm/include/SVF-LLVM/BasicTypes.h +3 -1
- package/svf-llvm/include/SVF-LLVM/BreakConstantExpr.h +24 -0
- package/svf-llvm/lib/LLVMModule.cpp +20 -0
- package/svf-llvm/lib/LLVMUtil.cpp +4 -0
- package/svf-llvm/lib/SVFIRBuilder.cpp +4 -0
package/build.sh
CHANGED
|
@@ -23,12 +23,12 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
|
23
23
|
SVFHOME="${SCRIPT_DIR}"
|
|
24
24
|
sysOS=$(uname -s)
|
|
25
25
|
arch=$(uname -m)
|
|
26
|
-
MajorLLVMVer=
|
|
27
|
-
LLVMVer=${MajorLLVMVer}.
|
|
28
|
-
UbuntuArmLLVM_RTTI="https://github.com/SVF-tools/SVF/releases/download/SVF-3.
|
|
26
|
+
MajorLLVMVer=18
|
|
27
|
+
LLVMVer=${MajorLLVMVer}.1.7
|
|
28
|
+
UbuntuArmLLVM_RTTI="https://github.com/SVF-tools/SVF/releases/download/SVF-3.2/llvm-${MajorLLVMVer}.1.0-ubuntu22-rtti-aarch64.tar.gz"
|
|
29
29
|
UbuntuArmLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-aarch64-linux-gnu.tar.xz"
|
|
30
|
-
UbuntuLLVM_RTTI="https://github.com/SVF-tools/SVF/releases/download/SVF-3.
|
|
31
|
-
UbuntuLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-x86_64-linux-gnu-ubuntu-
|
|
30
|
+
UbuntuLLVM_RTTI="https://github.com/SVF-tools/SVF/releases/download/SVF-3.2/llvm-${MajorLLVMVer}.1.0-ubuntu20-rtti-x86-64.tar.gz"
|
|
31
|
+
UbuntuLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-x86_64-linux-gnu-ubuntu-18.04.tar.xz"
|
|
32
32
|
SourceLLVM="https://github.com/llvm/llvm-project/archive/refs/tags/llvmorg-${LLVMVer}.zip"
|
|
33
33
|
UbuntuZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-ubuntu-16.04.zip"
|
|
34
34
|
UbuntuZ3Arm="https://github.com/SVF-tools/SVF-npm/raw/prebuilt-libs/z3-4.8.7-aarch64-ubuntu.zip"
|
|
@@ -36,7 +36,7 @@ SourceZ3="https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.8.8.zip"
|
|
|
36
36
|
|
|
37
37
|
# Keep LLVM version suffix for version checking and better debugging
|
|
38
38
|
# keep the version consistent with LLVM_DIR in setup.sh and llvm_version in Dockerfile
|
|
39
|
-
LLVMHome="llvm-${MajorLLVMVer}.
|
|
39
|
+
LLVMHome="llvm-${MajorLLVMVer}.1.0.obj"
|
|
40
40
|
Z3Home="z3.obj"
|
|
41
41
|
|
|
42
42
|
|
|
@@ -311,4 +311,4 @@ source ${SVFHOME}/setup.sh ${BUILD_TYPE}
|
|
|
311
311
|
#########
|
|
312
312
|
# Optionally, you can also specify a CXX_COMPILER and your $LLVM_HOME for your build
|
|
313
313
|
# cmake -DCMAKE_CXX_COMPILER=$LLVM_DIR/bin/clang++ -DLLVM_DIR=$LLVM_DIR
|
|
314
|
-
#########
|
|
314
|
+
#########
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svf-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1182",
|
|
4
4
|
"description": "* <b>[TypeClone](https://github.com/SVF-tools/SVF/wiki/TypeClone) published in our [ECOOP paper](https://yuleisui.github.io/publications/ecoop20.pdf) is now available in SVF </b> * <b>SVF now uses a single script for its build. Just type [`source ./build.sh`](https://github.com/SVF-tools/SVF/blob/master/build.sh) in your terminal, that's it!</b> * <b>SVF now supports LLVM-10.0.0! </b> * <b>We thank [bsauce](https://github.com/bsauce) for writing a user manual of SVF ([link1](https://www.jianshu.com/p/068a08ec749c) and [link2](https://www.jianshu.com/p/777c30d4240e)) in Chinese </b> * <b>SVF now supports LLVM-9.0.0 (Thank [Byoungyoung Lee](https://github.com/SVF-tools/SVF/issues/142) for his help!). </b> * <b>SVF now supports a set of [field-sensitive pointer analyses](https://yuleisui.github.io/publications/sas2019a.pdf). </b> * <b>[Use SVF as an external lib](https://github.com/SVF-tools/SVF/wiki/Using-SVF-as-a-lib-in-your-own-tool) for your own project (Contributed by [Hongxu Chen](https://github.com/HongxuChen)). </b> * <b>SVF now supports LLVM-7.0.0. </b> * <b>SVF now supports Docker. [Try SVF in Docker](https://github.com/SVF-tools/SVF/wiki/Try-SVF-in-Docker)! </b> * <b>SVF now supports [LLVM-6.0.0](https://github.com/svf-tools/SVF/pull/38) (Contributed by [Jack Anthony](https://github.com/jackanth)). </b> * <b>SVF now supports [LLVM-4.0.0](https://github.com/svf-tools/SVF/pull/23) (Contributed by Jared Carlson. Thank [Jared](https://github.com/jcarlson23) and [Will](https://github.com/dtzWill) for their in-depth [discussions](https://github.com/svf-tools/SVF/pull/18) about updating SVF!) </b> * <b>SVF now supports analysis for C++ programs.</b> <br />",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
package/svf-llvm/CMakeLists.txt
CHANGED
|
@@ -49,7 +49,22 @@ add_definitions(${_LLVM_DEFINITIONS})
|
|
|
49
49
|
if(LLVM_LINK_LLVM_DYLIB)
|
|
50
50
|
set(LLVM_LIBRARIES LLVM)
|
|
51
51
|
else()
|
|
52
|
-
llvm_map_components_to_libnames(LLVM_LIBRARIES
|
|
52
|
+
llvm_map_components_to_libnames(LLVM_LIBRARIES
|
|
53
|
+
analysis
|
|
54
|
+
bitwriter
|
|
55
|
+
core
|
|
56
|
+
instcombine
|
|
57
|
+
instrumentation
|
|
58
|
+
ipo
|
|
59
|
+
irreader
|
|
60
|
+
linker
|
|
61
|
+
scalaropts
|
|
62
|
+
support
|
|
63
|
+
target
|
|
64
|
+
transformutils
|
|
65
|
+
demangle
|
|
66
|
+
Passes
|
|
67
|
+
)
|
|
53
68
|
endif()
|
|
54
69
|
|
|
55
70
|
# Search in the executables dir for this LLVM's clang instance
|
|
@@ -72,8 +72,10 @@ typedef llvm::GlobalObject GlobalObject;
|
|
|
72
72
|
typedef llvm::Use Use;
|
|
73
73
|
typedef llvm::ModulePass ModulePass;
|
|
74
74
|
typedef llvm::IRBuilder<> IRBuilder;
|
|
75
|
-
#if LLVM_VERSION_MAJOR >= 12
|
|
75
|
+
#if LLVM_VERSION_MAJOR >= 12 && LLVM_VERSION_MAJOR <= 16
|
|
76
76
|
typedef llvm::UnifyFunctionExitNodesLegacyPass UnifyFunctionExitNodes;
|
|
77
|
+
#elif LLVM_VERSION_MAJOR > 16
|
|
78
|
+
typedef llvm::UnifyFunctionExitNodesPass UnifyFunctionExitNodes;
|
|
77
79
|
#else
|
|
78
80
|
typedef llvm::UnifyFunctionExitNodes UnifyFunctionExitNodes;
|
|
79
81
|
#endif
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
#ifndef BREAKCONSTANTGEPS_H
|
|
16
16
|
#define BREAKCONSTANTGEPS_H
|
|
17
17
|
|
|
18
|
+
#if LLVM_VERSION_MAJOR > 16
|
|
19
|
+
#include "llvm/Passes/PassBuilder.h"
|
|
20
|
+
#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
|
|
21
|
+
#endif
|
|
18
22
|
|
|
19
23
|
namespace SVF
|
|
20
24
|
{
|
|
@@ -77,6 +81,25 @@ public:
|
|
|
77
81
|
const Function& fun = *iter;
|
|
78
82
|
if(fun.isDeclaration())
|
|
79
83
|
continue;
|
|
84
|
+
#if LLVM_VERSION_MAJOR > 16
|
|
85
|
+
llvm::PassBuilder PB;
|
|
86
|
+
llvm::LoopAnalysisManager LAM;
|
|
87
|
+
llvm::FunctionAnalysisManager FAM;
|
|
88
|
+
llvm::CGSCCAnalysisManager CGAM;
|
|
89
|
+
llvm::ModuleAnalysisManager MAM;
|
|
90
|
+
|
|
91
|
+
PB.registerModuleAnalyses(MAM);
|
|
92
|
+
PB.registerCGSCCAnalyses(CGAM);
|
|
93
|
+
PB.registerFunctionAnalyses(FAM);
|
|
94
|
+
PB.registerLoopAnalyses(LAM);
|
|
95
|
+
PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
|
|
96
|
+
|
|
97
|
+
llvm::FunctionPassManager FPM;
|
|
98
|
+
FPM.addPass(llvm::UnifyFunctionExitNodesPass());
|
|
99
|
+
FPM.run(const_cast<llvm::Function&>(fun), FAM);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
#else
|
|
80
103
|
getUnifyExit(fun)->runOnFunction(const_cast<Function&>(fun));
|
|
81
104
|
}
|
|
82
105
|
}
|
|
@@ -86,6 +109,7 @@ public:
|
|
|
86
109
|
assert(!fn.isDeclaration() && "external function does not have DF");
|
|
87
110
|
return &getAnalysis<UnifyFunctionExitNodes>(const_cast<Function&>(fn));
|
|
88
111
|
}
|
|
112
|
+
#endif
|
|
89
113
|
};
|
|
90
114
|
|
|
91
115
|
} // End namespace SVF
|
|
@@ -45,6 +45,10 @@
|
|
|
45
45
|
#include "Graphs/CallGraph.h"
|
|
46
46
|
#include "Util/CallGraphBuilder.h"
|
|
47
47
|
|
|
48
|
+
#if LLVM_VERSION_MAJOR > 16
|
|
49
|
+
#include <llvm/Passes/PassBuilder.h>
|
|
50
|
+
#endif
|
|
51
|
+
|
|
48
52
|
using namespace std;
|
|
49
53
|
using namespace SVF;
|
|
50
54
|
|
|
@@ -267,7 +271,23 @@ void LLVMModuleSet::prePassSchedule()
|
|
|
267
271
|
Function &fun = *F;
|
|
268
272
|
if (fun.isDeclaration())
|
|
269
273
|
continue;
|
|
274
|
+
#if LLVM_VERSION_MAJOR <= 16
|
|
270
275
|
p2->runOnFunction(fun);
|
|
276
|
+
#else
|
|
277
|
+
llvm::PassBuilder PB;
|
|
278
|
+
llvm::LoopAnalysisManager LAM;
|
|
279
|
+
llvm::FunctionAnalysisManager FAM;
|
|
280
|
+
llvm::CGSCCAnalysisManager CGAM;
|
|
281
|
+
llvm::ModuleAnalysisManager MAM;
|
|
282
|
+
PB.registerModuleAnalyses(MAM);
|
|
283
|
+
PB.registerCGSCCAnalyses(CGAM);
|
|
284
|
+
PB.registerFunctionAnalyses(FAM);
|
|
285
|
+
PB.registerLoopAnalyses(LAM);
|
|
286
|
+
PB.crossRegisterProxies(LAM, FAM, CGAM, MAM);
|
|
287
|
+
llvm::FunctionPassManager FPM;
|
|
288
|
+
// FPM.addPass(llvm::UnifyFunctionExitNodesPass());
|
|
289
|
+
FPM.run(fun, FAM);
|
|
290
|
+
#endif
|
|
271
291
|
}
|
|
272
292
|
}
|
|
273
293
|
}
|
|
@@ -461,7 +461,11 @@ const std::string LLVMUtil::getSourceLoc(const Value* val )
|
|
|
461
461
|
{
|
|
462
462
|
if (SVFUtil::isa<AllocaInst>(inst))
|
|
463
463
|
{
|
|
464
|
+
#if LLVM_VERSION_MAJOR > 16
|
|
465
|
+
for (llvm::DbgInfoIntrinsic *DII : llvm::findDbgDeclares(const_cast<Instruction*>(inst)))
|
|
466
|
+
#else
|
|
464
467
|
for (llvm::DbgInfoIntrinsic *DII : FindDbgDeclareUses(const_cast<Instruction*>(inst)))
|
|
468
|
+
#endif
|
|
465
469
|
{
|
|
466
470
|
if (llvm::DbgDeclareInst *DDI = SVFUtil::dyn_cast<llvm::DbgDeclareInst>(DII))
|
|
467
471
|
{
|
|
@@ -269,7 +269,11 @@ void SVFIRBuilder::initDomTree(FunObjVar* svffun, const Function* fun)
|
|
|
269
269
|
for (DominanceFrontierBase::const_iterator dfIter = df.begin(), eDfIter = df.end(); dfIter != eDfIter; dfIter++)
|
|
270
270
|
{
|
|
271
271
|
const BasicBlock* keyBB = dfIter->first;
|
|
272
|
+
#if LLVM_VERSION_MAJOR > 16
|
|
273
|
+
const llvm::SetVector<llvm::BasicBlock* >& domSet = dfIter->second;
|
|
274
|
+
#else
|
|
272
275
|
const std::set<BasicBlock* >& domSet = dfIter->second;
|
|
276
|
+
#endif
|
|
273
277
|
Set<const SVFBasicBlock*>& valueBasicBlocks = dfBBsMap[llvmModuleSet()->getSVFBasicBlock(keyBB)];
|
|
274
278
|
for (const BasicBlock* bbValue:domSet)
|
|
275
279
|
{
|