@@ -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;
@@ -852,14 +859,11 @@ getFailureName(FunctionImporter::ImportFailureReason Reason) {
852859// / Compute the list of functions to import for a given caller. Mark these
853860// / imported functions and the symbols they reference in their source module as
854861// / exported from their source module.
855- static void computeImportForFunction (
856- const FunctionSummary &Summary, const ModuleSummaryIndex &Index,
857- const unsigned Threshold, const GVSummaryMapTy &DefinedGVSummaries,
858- function_ref<bool (GlobalValue::GUID, const GlobalValueSummary *)>
859- isPrevailing,
862+ void ModuleImportsManager::computeImportForFunction (
863+ const FunctionSummary &Summary, const unsigned Threshold,
864+ const GVSummaryMapTy &DefinedGVSummaries,
860865 SmallVectorImpl<EdgeInfo> &Worklist, GlobalsImporter &GVImporter,
861866 FunctionImporter::ImportMapTy &ImportList,
862- DenseMap<StringRef, FunctionImporter::ExportSetTy> *ExportLists,
863867 FunctionImporter::ImportThresholdsTy &ImportThresholds) {
864868 GVImporter.onImportingSummary (Summary);
865869 static int ImportCount = 0 ;
@@ -1064,9 +1068,8 @@ void ModuleImportsManager::computeImportForModule(
10641068 // Skip import for global variables
10651069 continue ;
10661070 LLVM_DEBUG (dbgs () << " Initialize import for " << VI << " \n " );
1067- computeImportForFunction (*FuncSummary, Index, ImportInstrLimit,
1068- DefinedGVSummaries, IsPrevailing, Worklist, GVI,
1069- ImportList, ExportLists, ImportThresholds);
1071+ computeImportForFunction (*FuncSummary, ImportInstrLimit, DefinedGVSummaries,
1072+ Worklist, GVI, ImportList, ImportThresholds);
10701073 }
10711074
10721075 // Process the newly imported functions and add callees to the worklist.
@@ -1076,9 +1079,8 @@ void ModuleImportsManager::computeImportForModule(
10761079 auto Threshold = std::get<1 >(GVInfo);
10771080
10781081 if (auto *FS = dyn_cast<FunctionSummary>(Summary))
1079- computeImportForFunction (*FS, Index, Threshold, DefinedGVSummaries,
1080- IsPrevailing, Worklist, GVI, ImportList,
1081- ExportLists, ImportThresholds);
1082+ computeImportForFunction (*FS, Threshold, DefinedGVSummaries, Worklist,
1083+ GVI, ImportList, ImportThresholds);
10821084 }
10831085
10841086 // Print stats about functions considered but rejected for importing
0 commit comments