@@ -497,6 +497,13 @@ static const char *getFailureName(FunctionImporter::ImportFailureReason Reason);
497497
498498// / Determine the list of imports and exports for each module.
499499class ModuleImportsManager {
500+ void computeImportForFunction (
501+ const FunctionSummary &Summary, unsigned Threshold,
502+ const GVSummaryMapTy &DefinedGVSummaries,
503+ SmallVectorImpl<EdgeInfo> &Worklist, GlobalsImporter &GVImporter,
504+ FunctionImporter::ImportMapTy &ImportList,
505+ FunctionImporter::ImportThresholdsTy &ImportThresholds);
506+
500507protected:
501508 function_ref<bool (GlobalValue::GUID, const GlobalValueSummary *)>
502509 IsPrevailing;
@@ -851,14 +858,11 @@ getFailureName(FunctionImporter::ImportFailureReason Reason) {
851858// / Compute the list of functions to import for a given caller. Mark these
852859// / imported functions and the symbols they reference in their source module as
853860// / exported from their source module.
854- static void computeImportForFunction (
855- const FunctionSummary &Summary, const ModuleSummaryIndex &Index,
856- const unsigned Threshold, const GVSummaryMapTy &DefinedGVSummaries,
857- function_ref<bool (GlobalValue::GUID, const GlobalValueSummary *)>
858- isPrevailing,
861+ void ModuleImportsManager::computeImportForFunction (
862+ const FunctionSummary &Summary, const unsigned Threshold,
863+ const GVSummaryMapTy &DefinedGVSummaries,
859864 SmallVectorImpl<EdgeInfo> &Worklist, GlobalsImporter &GVImporter,
860865 FunctionImporter::ImportMapTy &ImportList,
861- DenseMap<StringRef, FunctionImporter::ExportSetTy> *ExportLists,
862866 FunctionImporter::ImportThresholdsTy &ImportThresholds) {
863867 GVImporter.onImportingSummary (Summary);
864868 static int ImportCount = 0 ;
@@ -1063,9 +1067,8 @@ void ModuleImportsManager::computeImportForModule(
10631067 // Skip import for global variables
10641068 continue ;
10651069 LLVM_DEBUG (dbgs () << " Initialize import for " << VI << " \n " );
1066- computeImportForFunction (*FuncSummary, Index, ImportInstrLimit,
1067- DefinedGVSummaries, IsPrevailing, Worklist, GVI,
1068- ImportList, ExportLists, ImportThresholds);
1070+ computeImportForFunction (*FuncSummary, ImportInstrLimit, DefinedGVSummaries,
1071+ Worklist, GVI, ImportList, ImportThresholds);
10691072 }
10701073
10711074 // Process the newly imported functions and add callees to the worklist.
@@ -1075,9 +1078,8 @@ void ModuleImportsManager::computeImportForModule(
10751078 auto Threshold = std::get<1 >(GVInfo);
10761079
10771080 if (auto *FS = dyn_cast<FunctionSummary>(Summary))
1078- computeImportForFunction (*FS, Index, Threshold, DefinedGVSummaries,
1079- IsPrevailing, Worklist, GVI, ImportList,
1080- ExportLists, ImportThresholds);
1081+ computeImportForFunction (*FS, Threshold, DefinedGVSummaries, Worklist,
1082+ GVI, ImportList, ImportThresholds);
10811083 }
10821084
10831085 // Print stats about functions considered but rejected for importing
0 commit comments