* Return a module identified by modPath, caching it in memory. * * Note that such a module may *not* be modified without copying, otherwise * the cache state would get corrupted. */
| 465 | * the cache state would get corrupted. |
| 466 | */ |
| 467 | static llvm::Module* |
| 468 | load_module_cached(llvm::StringRef modPath) |
| 469 | { |
| 470 | auto it = module_cache->find(modPath); |
| 471 | if (it == module_cache->end()) |
| 472 | { |
| 473 | it = module_cache->insert( |
| 474 | std::make_pair(modPath, load_module(modPath))).first; |
| 475 | } |
| 476 | |
| 477 | return it->second.get(); |
| 478 | } |
| 479 | |
| 480 | static std::unique_ptr<llvm::Module> |
| 481 | load_module(llvm::StringRef Identifier) |
no test coverage detected