#include "SVF-LLVM/SVFIRBuilder.h"
#include "Util/CommandLine.h"
#include "Util/Options.h"
#include "SVFIR/SVFFileSystem.h"
#include <iostream>
#include <string>
Go to the source code of this file.
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 54 of file llvm2svf.cpp.
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.
std::string replaceExtension(const std::string &path)
std::ostream & outs()
Overwrite llvm::outs()
◆ replaceExtension()
Definition at line 42 of file llvm2svf.cpp.
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";
std::ostream & errs()
Overwrite llvm::errs()