================ @@ -1558,6 +1562,60 @@ class InProcessThinBackend : public ThinBackendProc { return BackendThreadPool.getMaxConcurrency(); } }; + +/// This Backend will run ThinBackend process but throw away all the output from +/// the codegen. This class facilitates the first codegen round. +class NoOutputThinBackend : public InProcessThinBackend { +public: + NoOutputThinBackend( + const Config &Conf, ModuleSummaryIndex &CombinedIndex, + ThreadPoolStrategy ThinLTOParallelism, + const DenseMap<StringRef, GVSummaryMapTy> &ModuleToDefinedGVSummaries, + std::unique_ptr<std::vector<llvm::SmallString<0>>> Scratch) + : InProcessThinBackend( + Conf, CombinedIndex, ThinLTOParallelism, ModuleToDefinedGVSummaries, + // Allocate a scratch buffer for each task to write output to. + [Allocation = &*Scratch](unsigned Task, const Twine &ModuleName) { + return std::make_unique<CachedFileStream>( + std::make_unique<raw_svector_ostream>((*Allocation)[Task])); + }, + FileCache(), nullptr, false, false), ---------------- NuriAmari wrote:
Do you mind labelling these arguments with a comment including the name of the parameter like you've done below: `/*CodeGenOnly=*/true`. Same with the `OptimizedBitcodeThinBackend` constructor. https://github.com/llvm/llvm-project/pull/90933 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits