// Add the input files to the linking context.
for (std::unique_ptr<File> &file : files) {
- if (isReadingDirectiveSection)
- file.get()->parse();
+ if (isReadingDirectiveSection) {
+ File *f = file.get();
+ ctx.getTaskGroup().spawn([f] { f->parse(); });
+ }
ctx.getNodes().push_back(llvm::make_unique<FileNode>(std::move(file)));
}
// Add the library files to the library group.
for (std::unique_ptr<File> &file : libraries) {
if (!hasLibrary(ctx, file.get())) {
- if (isReadingDirectiveSection)
- file.get()->parse();
+ if (isReadingDirectiveSection) {
+ File *f = file.get();
+ ctx.getTaskGroup().spawn([f] { f->parse(); });
+ }
ctx.addLibraryFile(llvm::make_unique<FileNode>(std::move(file)));
}
}