svf-lib 1.0.1029 → 1.0.1032

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.
@@ -104,6 +104,16 @@ inline bool isHeapAllocExtFunViaArg(const SVFFunction* fun)
104
104
  return fun && ExtAPI::getExtAPI()->is_arg_alloc(fun);
105
105
  }
106
106
 
107
+ static inline Type *getPtrElementType(const PointerType* pty)
108
+ {
109
+ #if (LLVM_VERSION_MAJOR < 14)
110
+ return pty->getElementType();
111
+ #else
112
+ assert(!pty->isOpaque() && "Opaque Pointer is used, please recompile the source adding '-Xclang -no-opaque-pointer'");
113
+ return pty->getNonOpaquePointerElementType();
114
+ #endif
115
+ }
116
+
107
117
  /// interfaces to be used externally
108
118
  inline bool isHeapAllocExtCallViaRet(const CallSite cs)
109
119
  {
@@ -248,7 +258,7 @@ inline const PointerType *getRefTypeOfHeapAllocOrStatic(const CallSite cs)
248
258
  int argPos = getHeapAllocHoldingArgPosition(cs);
249
259
  const Value *arg = cs.getArgument(argPos);
250
260
  if (const PointerType *argType = SVFUtil::dyn_cast<PointerType>(arg->getType()))
251
- refType = SVFUtil::dyn_cast<PointerType>(argType->getElementType());
261
+ refType = SVFUtil::dyn_cast<PointerType>(getPtrElementType(argType));
252
262
  }
253
263
  // Case 2: heap/static object held by return value.
254
264
  else
@@ -51,6 +51,10 @@
51
51
  #include <llvm/ADT/GraphTraits.h> // for Graphtraits
52
52
  #include <llvm/Transforms/Utils/Local.h> // for FindDbgAddrUses
53
53
 
54
+ #if (LLVM_VERSION_MAJOR >= 14)
55
+ #include <llvm/BinaryFormat/Dwarf.h>
56
+ #endif
57
+
54
58
  #include "llvm/Analysis/LoopInfo.h"
55
59
  #include "llvm/IR/CFG.h"
56
60
  #include "llvm/BinaryFormat/Dwarf.h"
Binary file
@@ -716,7 +716,7 @@ public:
716
716
  }
717
717
  };
718
718
 
719
- llvm::raw_ostream& operator<<(llvm::raw_ostream &o, const MRVer& mrver);
719
+ std::ostream& operator<<(std::ostream &o, const MRVer& mrver);
720
720
  } // End namespace SVF
721
721
 
722
722
  #endif /* MSSAMUCHI_H_ */
@@ -104,6 +104,16 @@ inline bool isHeapAllocExtFunViaArg(const SVFFunction* fun)
104
104
  return fun && ExtAPI::getExtAPI()->is_arg_alloc(fun);
105
105
  }
106
106
 
107
+ static inline Type *getPtrElementType(const PointerType* pty)
108
+ {
109
+ #if (LLVM_VERSION_MAJOR < 14)
110
+ return pty->getElementType();
111
+ #else
112
+ assert(!pty->isOpaque() && "Opaque Pointer is used, please recompile the source adding '-Xclang -no-opaque-pointer'");
113
+ return pty->getNonOpaquePointerElementType();
114
+ #endif
115
+ }
116
+
107
117
  /// interfaces to be used externally
108
118
  inline bool isHeapAllocExtCallViaRet(const CallSite cs)
109
119
  {
@@ -248,7 +258,7 @@ inline const PointerType *getRefTypeOfHeapAllocOrStatic(const CallSite cs)
248
258
  int argPos = getHeapAllocHoldingArgPosition(cs);
249
259
  const Value *arg = cs.getArgument(argPos);
250
260
  if (const PointerType *argType = SVFUtil::dyn_cast<PointerType>(arg->getType()))
251
- refType = SVFUtil::dyn_cast<PointerType>(argType->getElementType());
261
+ refType = SVFUtil::dyn_cast<PointerType>(getPtrElementType(argType));
252
262
  }
253
263
  // Case 2: heap/static object held by return value.
254
264
  else
@@ -51,6 +51,10 @@
51
51
  #include <llvm/ADT/GraphTraits.h> // for Graphtraits
52
52
  #include <llvm/Transforms/Utils/Local.h> // for FindDbgAddrUses
53
53
 
54
+ #if (LLVM_VERSION_MAJOR >= 14)
55
+ #include <llvm/BinaryFormat/Dwarf.h>
56
+ #endif
57
+
54
58
  #include "llvm/Analysis/LoopInfo.h"
55
59
  #include "llvm/IR/CFG.h"
56
60
  #include "llvm/BinaryFormat/Dwarf.h"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svf-lib",
3
- "version": "1.0.1029",
3
+ "version": "1.0.1032",
4
4
  "description": "SVF's npm support",
5
5
  "main": "index.js",
6
6
  "scripts": {