@@ -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;
@@ -851,14 +858,11 @@ getFailureName(FunctionImporter::ImportFailureReason Reason) {
851
858
// / Compute the list of functions to import for a given caller. Mark these
852
859
// / imported functions and the symbols they reference in their source module as
853
860
// / 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,
859
864
SmallVectorImpl<EdgeInfo> &Worklist, GlobalsImporter &GVImporter,
860
865
FunctionImporter::ImportMapTy &ImportList,
861
- DenseMap<StringRef, FunctionImporter::ExportSetTy> *ExportLists,
862
866
FunctionImporter::ImportThresholdsTy &ImportThresholds) {
863
867
GVImporter.onImportingSummary (Summary);
864
868
static int ImportCount = 0 ;
@@ -1063,9 +1067,8 @@ void ModuleImportsManager::computeImportForModule(
1063
1067
// Skip import for global variables
1064
1068
continue ;
1065
1069
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);
1069
1072
}
1070
1073
1071
1074
// Process the newly imported functions and add callees to the worklist.
@@ -1075,9 +1078,8 @@ void ModuleImportsManager::computeImportForModule(
1075
1078
auto Threshold = std::get<1 >(GVInfo);
1076
1079
1077
1080
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);
1081
1083
}
1082
1084
1083
1085
// Print stats about functions considered but rejected for importing
0 commit comments