]> granicus.if.org Git - llvm/commitdiff
[ThinLTO] Revert part of r289843 that belonged to another patch.
authorTeresa Johnson <tejohnson@google.com>
Thu, 15 Dec 2016 21:39:42 +0000 (21:39 +0000)
committerTeresa Johnson <tejohnson@google.com>
Thu, 15 Dec 2016 21:39:42 +0000 (21:39 +0000)
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

index 7875db2796a4c680da0f656835213962469c7e3d..799d402d6e45648ca8738df94dfe7aa37acff133 100644 (file)
@@ -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);
       }
     }