| 60 | } |
| 61 | |
| 62 | std::unique_ptr<SourceCollection> CompileHelper::load() { |
| 63 | if (!IRFile) |
| 64 | return nullptr; |
| 65 | |
| 66 | std::vector<std::unique_ptr<clang::ASTUnit>> ASTUnits; |
| 67 | for (auto &ASTFile : ASTFiles) { |
| 68 | if (!ASTFile.Ptr) |
| 69 | continue; |
| 70 | ASTUnits.emplace_back(std::move(ASTFile.Ptr)); |
| 71 | } |
| 72 | return std::make_unique<SourceCollection>(std::move(IRFile->Ptr), |
| 73 | std::move(IRFile->Ctx), |
| 74 | std::move(ASTUnits), SrcDir); |
| 75 | } |
| 76 | |
| 77 | CompileHelper::~CompileHelper() { |
| 78 | for (auto &Iter : SourceFiles) { |