33#include "Util/config.h"
77 if (
path ==
"SVF_DIR")
90 else if (
path ==
"npm root")
95 "command -v npm >/dev/null 2>&1 && npm root"
185 SVFUtil::errs() <<
"ERROR: Failed to locate \"extapi.bc\". Tried the following candidate paths:" << std::endl;
190 SVFUtil::errs() <<
"To override the default locations for \"extapi.bc\", you can:" << std::endl
191 <<
"\t1. Use the command line argument \"-extapi=path/to/extapi.bc\"" << std::endl
192 <<
"\t2. Use the \"setExtBcPath()\" function *BEFORE* calling \"buildSVFModule()\"" << std::endl
193 <<
"\t3. Override the paths in \"include/SVF/Util/config.h\" (WARNING: will be overwritten "
194 <<
"when rebuilding SVF (generated by CMakeLists.txt))" << std::endl;
201 assert(fun &&
"Null FunObjVar* pointer");
207 assert(fun &&
"Null FunObjVar* pointer");
211 for (
const std::string&
annotation : it->second)
221 assert(fun &&
"Null FunObjVar* pointer");
225 for (
const std::string&
annotation : it->second)
234 assert(fun &&
"Null FunObjVar* pointer");
273 assert(!
allocArg.empty() &&
"Not an alloc call via argument or incorrect extern function annotation!");
281 assert(!
number.empty() &&
"Incorrect naming convention for svf external functions(ALLOC_HEAP_ARG + number)?");
292 assert(F &&
"Null FunObjVar* pointer");
static std::string getFilePath(const std::string &path)
const char *const const double number
bool is_alloc_stack_ret(const FunObjVar *F)
bool is_arg_alloc(const FunObjVar *F)
bool is_memcpy(const FunObjVar *F)
std::string getExtBcPath()
static std::string extBcPath
s32_t get_alloc_arg_pos(const FunObjVar *F)
static ExtAPI * getExtAPI()
bool is_ext(const FunObjVar *funObjVar)
std::string getExtFuncAnnotation(const FunObjVar *fun, const std::string &funcAnnotation)
bool is_realloc(const FunObjVar *F)
Map< const FunObjVar *, std::vector< std::string > > funObjVar2Annotations
void setExtFuncAnnotations(const FunObjVar *fun, const std::vector< std::string > &funcAnnotations)
static bool setExtBcPath(const std::string &path)
bool hasExtFuncAnnotation(const FunObjVar *fun, const std::string &funcAnnotation)
bool is_alloc(const FunObjVar *F)
const std::vector< std::string > & getExtFuncAnnotations(const FunObjVar *fun)
bool is_memset(const FunObjVar *F)
bool isDeclaration() const
static const Option< std::string > ExtAPIPath
char * getenv(const char *name)
std::ostream & errs()
Overwrite llvm::errs()
bool fileExists(const std::string &path)
Check whether a file exists at the given path.
std::string getCurrentSOPath()
Return the absolute path of the current module/executable.
std::string getStdoutFromCommand(const std::string &command)
Execute a shell command and capture its stdout output.
llvm::IRBuilder IRBuilder