[ThinLTO] Release files in gold plugin during combined index (take 2)
[oota-llvm.git] / tools / gold / gold-plugin.cpp
index d73e94922666cd8372f9bd6c1ce2b899e7f6944c..e52606b8828b74ff4497b897506b28a89af058bd 100644 (file)
@@ -855,10 +855,8 @@ static ld_plugin_status allSymbolsReadHook(raw_fd_ostream *ApiFile) {
           getFunctionIndexForFile(F, File);
 
       // Skip files without a function summary.
-      if (!Index)
-        continue;
-
-      CombinedIndex.mergeFrom(std::move(Index), ++NextModuleId);
+      if (Index)
+        CombinedIndex.mergeFrom(std::move(Index), ++NextModuleId);
 
       if (release_input_file(F.handle) != LDPS_OK)
         message(LDPL_FATAL, "Failed to release file information");