| 293 | } |
| 294 | |
| 295 | void LLVMModuleSet::preProcessBCs(std::vector<std::string> &moduleNameVec) |
| 296 | { |
| 297 | LLVMModuleSet* mset = getLLVMModuleSet(); |
| 298 | mset->loadModules(moduleNameVec); |
| 299 | mset->loadExtAPIModules(); |
| 300 | mset->prePassSchedule(); |
| 301 | |
| 302 | std::string preProcessSuffix = ".pre.bc"; |
| 303 | // Get the existing module names, remove old extension, add preProcessSuffix |
| 304 | for (u32_t i = 0; i < moduleNameVec.size(); i++) |
| 305 | { |
| 306 | u32_t lastIndex = moduleNameVec[i].find_last_of("."); |
| 307 | std::string rawName = moduleNameVec[i].substr(0, lastIndex); |
| 308 | moduleNameVec[i] = (rawName + preProcessSuffix); |
| 309 | } |
| 310 | |
| 311 | mset->dumpModulesToFile(preProcessSuffix); |
| 312 | preProcessed = true; |
| 313 | releaseLLVMModuleSet(); |
| 314 | } |
| 315 | |
| 316 | void LLVMModuleSet::loadModules(const std::vector<std::string> &moduleNameVec) |
| 317 | { |
nothing calls this directly
no test coverage detected