44 size_t pos = path.rfind(
'.');
45 if (pos == std::string::npos ||
46 (path.substr(pos) !=
".bc" && path.substr(pos) !=
".ll"))
48 SVFUtil::errs() <<
"Error: expect file with extension .bc or .ll\n";
51 return path.substr(0, pos) +
".svf.json";
54 int main(
int argc,
char** argv)
57 argc, argv,
"llvm2svf",
"[options] <input-bitcode...>");
59 if (Options::WriteAnder() ==
"ir_annotator")
61 LLVMModuleSet::preProcessBCs(moduleNameVec);
64 SVFModule* svfModule = LLVMModuleSet::buildSVFModule(moduleNameVec);
69 SVFIRWriter::writeJsonToPath(pag, jsonPath);
70 SVFUtil::outs() <<
"SVF IR is written to '" << jsonPath <<
"'\n";
71 LLVMModuleSet::releaseLLVMModuleSet();
static std::vector< std::string > parseOptions(int argc, char *argv[], std::string description, std::string callFormat)
virtual SVFIR * build()
Start building SVFIR here.
int main(int argc, char **argv)
std::string replaceExtension(const std::string &path)
std::ostream & errs()
Overwrite llvm::errs()
std::ostream & outs()
Overwrite llvm::outs()