[llvm] r279212 - [LTO] Move callback member from base class to the derived where it is used (NFC)

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 23:10:04 PDT 2016


Author: mehdi_amini
Date: Fri Aug 19 01:10:03 2016
New Revision: 279212

URL: http://llvm.org/viewvc/llvm-project?rev=279212&view=rev
Log:
[LTO] Move callback member from base class to the derived where it is used (NFC)

Modified:
    llvm/trunk/lib/LTO/LTO.cpp

Modified: llvm/trunk/lib/LTO/LTO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTO.cpp?rev=279212&r1=279211&r2=279212&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTO.cpp (original)
+++ llvm/trunk/lib/LTO/LTO.cpp Fri Aug 19 01:10:03 2016
@@ -397,14 +397,12 @@ class lto::ThinBackendProc {
 protected:
   Config &Conf;
   ModuleSummaryIndex &CombinedIndex;
-  AddOutputFn AddOutput;
   StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries;
 
 public:
   ThinBackendProc(Config &Conf, ModuleSummaryIndex &CombinedIndex,
-                  AddOutputFn AddOutput,
                   StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries)
-      : Conf(Conf), CombinedIndex(CombinedIndex), AddOutput(AddOutput),
+      : Conf(Conf), CombinedIndex(CombinedIndex),
         ModuleToDefinedGVSummaries(ModuleToDefinedGVSummaries) {}
 
   virtual ~ThinBackendProc() {}
@@ -416,6 +414,7 @@ public:
 
 class InProcessThinBackend : public ThinBackendProc {
   ThreadPool BackendThreadPool;
+  AddOutputFn AddOutput;
 
   Optional<Error> Err;
   std::mutex ErrMu;
@@ -425,9 +424,9 @@ public:
                        unsigned ThinLTOParallelismLevel,
                        StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
                        AddOutputFn AddOutput)
-      : ThinBackendProc(Conf, CombinedIndex, AddOutput,
-                        ModuleToDefinedGVSummaries),
-        BackendThreadPool(ThinLTOParallelismLevel) {}
+      : ThinBackendProc(Conf, CombinedIndex, ModuleToDefinedGVSummaries),
+        BackendThreadPool(ThinLTOParallelismLevel),
+        AddOutput(std::move(AddOutput)) {}
 
   Error
   runThinLTOBackendThread(AddOutputFn AddOutput, unsigned Task,
@@ -500,11 +499,10 @@ class WriteIndexesThinBackend : public T
 public:
   WriteIndexesThinBackend(Config &Conf, ModuleSummaryIndex &CombinedIndex,
                           StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
-                          AddOutputFn AddOutput, std::string OldPrefix,
-                          std::string NewPrefix, bool ShouldEmitImportsFiles,
+                          std::string OldPrefix, std::string NewPrefix,
+                          bool ShouldEmitImportsFiles,
                           std::string LinkedObjectsFileName)
-      : ThinBackendProc(Conf, CombinedIndex, AddOutput,
-                        ModuleToDefinedGVSummaries),
+      : ThinBackendProc(Conf, CombinedIndex, ModuleToDefinedGVSummaries),
         OldPrefix(OldPrefix), NewPrefix(NewPrefix),
         ShouldEmitImportsFiles(ShouldEmitImportsFiles),
         LinkedObjectsFileName(LinkedObjectsFileName) {}
@@ -574,8 +572,8 @@ ThinBackend lto::createWriteIndexesThinB
              StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries,
              AddOutputFn AddOutput) {
     return llvm::make_unique<WriteIndexesThinBackend>(
-        Conf, CombinedIndex, ModuleToDefinedGVSummaries, AddOutput, OldPrefix,
-        NewPrefix, ShouldEmitImportsFiles, LinkedObjectsFile);
+        Conf, CombinedIndex, ModuleToDefinedGVSummaries, OldPrefix, NewPrefix,
+        ShouldEmitImportsFiles, LinkedObjectsFile);
   };
 }
 




More information about the llvm-commits mailing list