svf-lib 1.0.1847 → 1.0.1849

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.
@@ -350,8 +350,8 @@ struct GenericGraphTraits<SVF::CHNode*>
350
350
  /// for inverse traversal.
351
351
  template <>
352
352
  struct GenericGraphTraits<Inverse<SVF::CHNode*>>
353
- : public GenericGraphTraits<
354
- Inverse<SVF::GenericNode<SVF::CHNode, SVF::CHEdge>*>>
353
+ : public GenericGraphTraits<
354
+ Inverse<SVF::GenericNode<SVF::CHNode, SVF::CHEdge>*>>
355
355
  {
356
356
  };
357
357
 
@@ -115,7 +115,7 @@ nodes(const GraphType &G)
115
115
  }
116
116
  template <class GraphType>
117
117
  iter_range<typename GenericGraphTraits<Inverse<GraphType>>::nodes_iterator>
118
- inverse_nodes(const GraphType &G)
118
+ inverse_nodes(const GraphType &G)
119
119
  {
120
120
  return make_range(GenericGraphTraits<Inverse<GraphType>>::nodes_begin(G),
121
121
  GenericGraphTraits<Inverse<GraphType>>::nodes_end(G));
@@ -131,7 +131,7 @@ children(const typename GenericGraphTraits<GraphType>::NodeRef &G)
131
131
 
132
132
  template <class GraphType>
133
133
  iter_range<typename GenericGraphTraits<Inverse<GraphType>>::ChildIteratorType>
134
- inverse_children(const typename GenericGraphTraits<GraphType>::NodeRef &G)
134
+ inverse_children(const typename GenericGraphTraits<GraphType>::NodeRef &G)
135
135
  {
136
136
  return make_range(GenericGraphTraits<Inverse<GraphType>>::child_begin(G),
137
137
  GenericGraphTraits<Inverse<GraphType>>::child_end(G));
@@ -382,7 +382,7 @@ inline typename cast_retty<X, Y *>::ret_type cast(Y *Val)
382
382
 
383
383
  template <class X, class Y>
384
384
  inline typename cast_retty<X, std::unique_ptr<Y>>::ret_type
385
- cast(std::unique_ptr<Y> &&Val)
385
+ cast(std::unique_ptr<Y> &&Val)
386
386
  {
387
387
  assert(SVFUtil::isa<X>(Val.get()) && "cast<Ty>() argument of incompatible type!");
388
388
  using ret_type = typename cast_retty<X, std::unique_ptr<Y>>::ret_type;
@@ -192,8 +192,8 @@ public:
192
192
 
193
193
  // From all the candidates, returns the best mapping for pointsToSets (points-to set -> # occurrences).
194
194
  static inline std::pair<hclust_fast_methods, std::vector<NodeID>> determineBestMapping(
195
- const std::vector<std::pair<hclust_fast_methods, std::vector<NodeID>>> &candidates,
196
- Map<PointsTo, unsigned> pointsToSets, const std::string &evalSubtitle, double &evalTime);
195
+ const std::vector<std::pair<hclust_fast_methods, std::vector<NodeID>>> &candidates,
196
+ Map<PointsTo, unsigned> pointsToSets, const std::string &evalSubtitle, double &evalTime);
197
197
 
198
198
  };
199
199
  };
@@ -260,6 +260,7 @@ public:
260
260
  // Loop Analysis
261
261
  static const Option<bool> LoopAnalysis;
262
262
  static const Option<u32_t> LoopBound;
263
+
263
264
  };
264
265
  } // namespace SVF
265
266
 
@@ -352,7 +352,7 @@ struct pointee_iter
352
352
  template <typename RangeT, typename WrappedIteratorT =
353
353
  decltype(std::begin(std::declval<RangeT>()))>
354
354
  iter_range<pointee_iter<WrappedIteratorT>>
355
- make_pointee_range(RangeT &&Range)
355
+ make_pointee_range(RangeT &&Range)
356
356
  {
357
357
  using PointeeIteratorT = pointee_iter<WrappedIteratorT>;
358
358
  return make_range(PointeeIteratorT(std::begin(std::forward<RangeT>(Range))),
@@ -388,7 +388,7 @@ public:
388
388
  template <typename RangeT, typename WrappedIteratorT =
389
389
  decltype(std::begin(std::declval<RangeT>()))>
390
390
  iter_range<pointer_iterator<WrappedIteratorT>>
391
- make_pointer_range(RangeT &&Range)
391
+ make_pointer_range(RangeT &&Range)
392
392
  {
393
393
  using PointerIteratorT = pointer_iterator<WrappedIteratorT>;
394
394
  return make_range(PointerIteratorT(std::begin(std::forward<RangeT>(Range))),
package/llvm_install.sh CHANGED
@@ -1,29 +1,48 @@
1
1
  #!/bin/bash
2
2
  SVFHOME=$(pwd)
3
3
  sysOS=`uname -s`
4
- MacLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-apple-darwin.tar.xz"
5
- UbuntuLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.0/clang+llvm-14.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz"
4
+ MajorLLVMVer=16
5
+ LLVMVer=${MajorLLVMVer}.0.0
6
+ UbuntuLLVM="https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVMVer}/clang+llvm-${LLVMVer}-x86_64-linux-gnu-ubuntu-18.04.tar.xz"
6
7
  MacZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-osx-10.14.6.zip"
7
8
  UbuntuZ3="https://github.com/Z3Prover/z3/releases/download/z3-4.8.8/z3-4.8.8-x64-ubuntu-16.04.zip"
8
9
  Z3Home="z3.obj"
9
- LLVMHome="llvm-14.0.0.obj"
10
+ LLVMHome="llvm-${LLVMVer}.obj"
10
11
  cd $SVFHOME
11
12
  cd ..
12
13
  install_path=$(pwd)
14
+
15
+ function check_and_install_brew {
16
+ if command -v brew >/dev/null 2>&1; then
17
+ echo "Homebrew is already installed."
18
+ else
19
+ echo "Homebrew not found. Installing Homebrew..."
20
+ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
21
+ if [ $? -eq 0 ]; then
22
+ echo "Homebrew installation completed."
23
+ else
24
+ echo "Homebrew installation failed."
25
+ exit 1
26
+ fi
27
+ fi
28
+ }
29
+
13
30
  ########
14
31
  # Download LLVM binary
15
32
  ########
16
33
  if [[ $sysOS == "Darwin" ]]
17
34
  then
18
- if [ ! -d "$install_path/$LLVMHome" ]
19
- then
20
- echo 'Downloading LLVM binary for MacOS '
21
- curl -L $MacLLVM > llvm-mac.tar.xz
22
- mkdir $install_path/$LLVMHome
23
- echo 'Unzipping LLVM binary for MacOS '
24
- tar -xf "llvm-mac.tar.xz" -C $install_path/$LLVMHome --strip-components 1
25
- rm llvm-mac.tar.xz
35
+ check_and_install_brew
36
+ echo "Installing LLVM binary"
37
+ brew install llvm@${MajorLLVMVer}
38
+ # check whether llvm is installed
39
+ if [ $? -eq 0 ]; then
40
+ echo "LLVM binary installation completed."
41
+ else
42
+ echo "LLVM binary installation failed."
43
+ exit 1
26
44
  fi
45
+ export LLVM_DIR="$(brew --prefix llvm@${MajorLLVMVer})"
27
46
  elif [[ $sysOS == "Linux" ]]
28
47
  then
29
48
  if [ ! -d "$install_path/$LLVMHome" ]
@@ -34,11 +53,12 @@ then
34
53
  echo 'Unzipping LLVM binary for Ubuntu'
35
54
  tar -xf "llvm-ubuntu.tar.xz" -C $install_path/$LLVMHome --strip-components 1
36
55
  rm llvm-ubuntu.tar.xz
56
+ export LLVM_DIR="$install_path/$LLVMHome"
37
57
  fi
38
58
  else
39
59
  echo 'not support llvm builds in OS other than Ubuntu and Mac'
40
60
  fi
41
- echo "LLVM_DIR=$install_path/$LLVMHome"
61
+ echo "LLVM_DIR=$LLVM_DIR"
42
62
  ########
43
63
  # Download z3 binary
44
64
  ########
@@ -67,15 +87,17 @@ then
67
87
  else
68
88
  echo 'not support z3 builds in OS other than Ubuntu and Mac'
69
89
  fi
70
- echo "Z3_DIR=$install_path/$Z3Home"
90
+ export Z3_DIR="$install_path/$Z3Home"
91
+ echo "Z3_DIR=$Z3_DIR"
92
+ export SVF_DIR="$install_path/SVF"
93
+ echo "SVF_DIR=$SVF_DIR"
94
+
71
95
  if [[ $sysOS == "Darwin" ]]
72
96
  then
73
- ln -s $install_path/svf-lib/SVF-osx $install_path/SVF
74
- echo "SVF_DIR=$install_path/SVF/"
75
- echo -e "Build your own project with the following cmake command:\n cmake -DSVF_DIR=$install_path/SVF/SVF-osx -DLLVM_DIR=$install_path/$LLVMHome"
97
+ ln -s $install_path/svf-lib/SVF-osx $SVF_DIR
98
+ echo -e "Build your own project with the following cmake command:\n cmake -DSVF_DIR=$SVF_DIR -DLLVM_DIR=$LLVM_DIR"
76
99
  elif [[ $sysOS == "Linux" ]]
77
100
  then
78
- ln -s $install_path/svf-lib/SVF-linux $install_path/SVF
79
- echo "SVF_DIR=$install_path/SVF/"
80
- echo -e "Build your own project with the following cmake command:\n cmake -DSVF_DIR=$install_path/SVF/SVF-linux -DLLVM_DIR=$install_path/$LLVMHome"
101
+ ln -s $install_path/svf-lib/SVF-linux $SVF_DIR
102
+ echo -e "Build your own project with the following cmake command:\n cmake -DSVF_DIR=$SVF_DIR -DLLVM_DIR=$LLVM_DIR"
81
103
  fi
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1847",
3
+ "version": "1.0.1849",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {