Skip to content

Commit

Permalink
[LTO] Move callback member from base class to the derived where it is…
Browse files Browse the repository at this point in the history
… used (NFC)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279212 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
joker-eph committed Aug 19, 2016
1 parent 855d81d commit dfdbbee
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions lib/LTO/LTO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}
Expand All @@ -416,6 +414,7 @@ class lto::ThinBackendProc {

class InProcessThinBackend : public ThinBackendProc {
ThreadPool BackendThreadPool;
AddOutputFn AddOutput;

Optional<Error> Err;
std::mutex ErrMu;
Expand All @@ -425,9 +424,9 @@ class InProcessThinBackend : public ThinBackendProc {
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,
Expand Down Expand Up @@ -500,11 +499,10 @@ class WriteIndexesThinBackend : public ThinBackendProc {
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) {}
Expand Down Expand Up @@ -574,8 +572,8 @@ ThinBackend lto::createWriteIndexesThinBackend(std::string OldPrefix,
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);
};
}

Expand Down

0 comments on commit dfdbbee

Please sign in to comment.