33#include "Util/config.h"
81 return "popen failed!";
100 if (
path.compare(
"SVF_DIR") == 0)
106 else if (
path.compare(
"npm root") == 0)
156 <<
"To override the default locations for \"extapi.bc\", you can:" << std::endl
157 <<
"\t1. Use the command line argument \"-extapi=path/to/extapi.bc\"" << std::endl
158 <<
"\t2. Use the \"setExtBcPath()\" function *BEFORE* calling \"buildSVFModule()\"" << std::endl
159 <<
"\t3. Override the paths in \"svf/Util/config.h\" (WARNING: will be overwritten when "
160 <<
"rebuilding SVF (generated by CMakeLists.txt))" << std::endl;
166 assert(fun &&
"Null SVFFunction* pointer");
172 assert(fun &&
"Null SVFFunction* pointer");
185 assert(fun &&
"Null SVFFunction* pointer");
198 assert(fun &&
"Null SVFFunction* pointer");
237 assert(!
allocArg.empty() &&
"Not an alloc call via argument or incorrect extern function annotation!");
245 assert(!
number.empty() &&
"Incorrect naming convention for svf external functions(ALLOC_HEAP_ARG + number)?");
260 assert(
F &&
"Null SVFFunction* pointer");
261 if (
F->isDeclaration() ||
F->isIntrinsic())
static std::string GetStdoutFromCommand(const std::string &command)
static std::string getFilePath(const std::string &path)
const char *const const double number
bool is_alloc(const SVFFunction *F)
bool is_arg_alloc(const SVFFunction *F)
bool hasExtFuncAnnotation(const SVFFunction *fun, const std::string &funcAnnotation)
bool is_ext(const SVFFunction *F)
std::string getExtBcPath()
const std::vector< std::string > & getExtFuncAnnotations(const SVFFunction *fun)
static std::string extBcPath
static ExtAPI * getExtAPI()
bool is_alloc_stack_ret(const SVFFunction *F)
std::string getExtFuncAnnotation(const SVFFunction *fun, const std::string &funcAnnotation)
s32_t get_alloc_arg_pos(const SVFFunction *F)
Map< const SVFFunction *, std::vector< std::string > > func2Annotations
bool is_memset(const SVFFunction *F)
bool is_memcpy(const SVFFunction *F)
static bool setExtBcPath(const std::string &path)
bool is_realloc(const SVFFunction *F)
void setExtFuncAnnotations(const SVFFunction *fun, const std::vector< std::string > &funcAnnotations)
static const Option< std::string > ExtAPIPath
char * fgets(char *str, int n, void *stream)
std::ostream & errs()
Overwrite llvm::errs()
llvm::IRBuilder IRBuilder