From 6a48d2eaa396a2e68ffd2a7ead78864fa576cd50 Mon Sep 17 00:00:00 2001 From: Teresa Johnson Date: Thu, 15 Dec 2016 21:39:42 +0000 Subject: [PATCH] [ThinLTO] Revert part of r289843 that belonged to another patch. The code change for D27687 accidentally got committed along with the main change in r289843. Revert it temporarily, so that I can recommit it along with its test as intended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289875 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/IPO/FunctionImport.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/Transforms/IPO/FunctionImport.cpp b/lib/Transforms/IPO/FunctionImport.cpp index 7875db2796a..799d402d6e4 100644 --- a/lib/Transforms/IPO/FunctionImport.cpp +++ b/lib/Transforms/IPO/FunctionImport.cpp @@ -338,7 +338,6 @@ static void computeImportForFunction( << ProcessedThreshold << "\n"); continue; } - bool PreviouslyImported = ProcessedThreshold != 0; // Mark this function as imported in this module, with the current Threshold ProcessedThreshold = AdjThreshold; @@ -346,18 +345,15 @@ static void computeImportForFunction( if (ExportLists) { auto &ExportList = (*ExportLists)[ExportModulePath]; ExportList.insert(GUID); - if (!PreviouslyImported) { - // This is the first time this function was exported from its source - // module, so mark all functions and globals it references as exported - // to the outside if they are defined in the same source module. - for (auto &Edge : ResolvedCalleeSummary->calls()) { - auto CalleeGUID = Edge.first.getGUID(); - exportGlobalInModule(Index, ExportModulePath, CalleeGUID, ExportList); - } - for (auto &Ref : ResolvedCalleeSummary->refs()) { - auto GUID = Ref.getGUID(); - exportGlobalInModule(Index, ExportModulePath, GUID, ExportList); - } + // Mark all functions and globals referenced by this function as exported + // to the outside if they are defined in the same source module. + for (auto &Edge : ResolvedCalleeSummary->calls()) { + auto CalleeGUID = Edge.first.getGUID(); + exportGlobalInModule(Index, ExportModulePath, CalleeGUID, ExportList); + } + for (auto &Ref : ResolvedCalleeSummary->refs()) { + auto GUID = Ref.getGUID(); + exportGlobalInModule(Index, ExportModulePath, GUID, ExportList); } } -- 2.49.0