Dump modules to files
| 1053 | |
| 1054 | // Dump modules to files |
| 1055 | void LLVMModuleSet::dumpModulesToFile(const std::string& suffix) |
| 1056 | { |
| 1057 | for (Module& mod : modules) |
| 1058 | { |
| 1059 | std::string moduleName = mod.getName().str(); |
| 1060 | std::string OutputFilename; |
| 1061 | std::size_t pos = moduleName.rfind('.'); |
| 1062 | if (pos != std::string::npos) |
| 1063 | OutputFilename = moduleName.substr(0, pos) + suffix; |
| 1064 | else |
| 1065 | OutputFilename = moduleName + suffix; |
| 1066 | |
| 1067 | std::error_code EC; |
| 1068 | raw_fd_ostream OS(OutputFilename.c_str(), EC, llvm::sys::fs::OF_None); |
| 1069 | |
| 1070 | #if (LLVM_VERSION_MAJOR >= 7) |
| 1071 | WriteBitcodeToFile(mod, OS); |
| 1072 | #else |
| 1073 | WriteBitcodeToFile(&mod, OS); |
| 1074 | #endif |
| 1075 | |
| 1076 | OS.flush(); |
| 1077 | } |
| 1078 | } |
| 1079 | |
| 1080 | NodeID LLVMModuleSet::getValueNode(const Value *llvm_value) |
| 1081 | { |
no outgoing calls
no test coverage detected