@@ -497,6 +497,13 @@ static const char *getFailureName(FunctionImporter::ImportFailureReason Reason);
497
497
498
498
// / Determine the list of imports and exports for each module.
499
499
class 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
+
500
507
protected:
501
508
function_ref<bool (GlobalValue::GUID, const GlobalValueSummary *)>
502
509
IsPrevailing;
@@ -852,14 +859,11 @@ getFailureName(FunctionImporter::ImportFailureReason Reason) {
852
859
// / Compute the list of functions to import for a given caller. Mark these
853
860
// / imported functions and the symbols they reference in their source module as
854
861
// / 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,
860
865
SmallVectorImpl<EdgeInfo> &Worklist, GlobalsImporter &GVImporter,
861
866
FunctionImporter::ImportMapTy &ImportList,
862
- DenseMap<StringRef, FunctionImporter::ExportSetTy> *ExportLists,
863
867
FunctionImporter::ImportThresholdsTy &ImportThresholds) {
864
868
GVImporter.onImportingSummary (Summary);
865
869
static int ImportCount = 0 ;
@@ -1064,9 +1068,8 @@ void ModuleImportsManager::computeImportForModule(
1064
1068
// Skip import for global variables
1065
1069
continue ;
1066
1070
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);
1070
1073
}
1071
1074
1072
1075
// Process the newly imported functions and add callees to the worklist.
@@ -1076,9 +1079,8 @@ void ModuleImportsManager::computeImportForModule(
1076
1079
auto Threshold = std::get<1 >(GVInfo);
1077
1080
1078
1081
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);
1082
1084
}
1083
1085
1084
1086
// Print stats about functions considered but rejected for importing
0 commit comments