r263494 - Revert "[ThinLTO] Clang side of renaming of function index (NFC)"

Teresa Johnson via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 14 14:18:17 PDT 2016


Author: tejohnson
Date: Mon Mar 14 16:18:17 2016
New Revision: 263494

URL: http://llvm.org/viewvc/llvm-project?rev=263494&view=rev
Log:
Revert "[ThinLTO] Clang side of renaming of function index (NFC)"

This reverts commit r263491. Missed a file on the LLVM side.

Modified:
    cfe/trunk/include/clang/CodeGen/BackendUtil.h
    cfe/trunk/include/clang/Frontend/CodeGenOptions.def
    cfe/trunk/lib/CodeGen/BackendUtil.cpp
    cfe/trunk/lib/Frontend/CompilerInvocation.cpp

Modified: cfe/trunk/include/clang/CodeGen/BackendUtil.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/CodeGen/BackendUtil.h?rev=263494&r1=263493&r2=263494&view=diff
==============================================================================
--- cfe/trunk/include/clang/CodeGen/BackendUtil.h (original)
+++ cfe/trunk/include/clang/CodeGen/BackendUtil.h Mon Mar 14 16:18:17 2016
@@ -11,7 +11,7 @@
 #define LLVM_CLANG_CODEGEN_BACKENDUTIL_H
 
 #include "clang/Basic/LLVM.h"
-#include "llvm/IR/ModuleSummaryIndex.h"
+#include "llvm/IR/FunctionInfo.h"
 #include <memory>
 
 namespace llvm {

Modified: cfe/trunk/include/clang/Frontend/CodeGenOptions.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/CodeGenOptions.def?rev=263494&r1=263493&r2=263494&view=diff
==============================================================================
--- cfe/trunk/include/clang/Frontend/CodeGenOptions.def (original)
+++ cfe/trunk/include/clang/Frontend/CodeGenOptions.def Mon Mar 14 16:18:17 2016
@@ -74,8 +74,8 @@ CODEGENOPT(LessPreciseFPMAD  , 1, 0) ///
                                      ///< be generated.
 CODEGENOPT(PrepareForLTO     , 1, 0) ///< Set when -flto is enabled on the
                                      ///< compile step.
-CODEGENOPT(EmitSummaryIndex, 1, 0)   ///< Set when -flto=thin is enabled on the
-                                     ///< compile step.
+CODEGENOPT(EmitFunctionSummary, 1, 0) ///< Set when -flto=thin is enabled on the
+                                      ///< compile step.
 CODEGENOPT(IncrementalLinkerCompatible, 1, 0) ///< Emit an object file which can
                                               ///< be used with an incremental
                                               ///< linker.

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=263494&r1=263493&r2=263494&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Mon Mar 14 16:18:17 2016
@@ -22,13 +22,13 @@
 #include "llvm/CodeGen/RegAllocRegistry.h"
 #include "llvm/CodeGen/SchedulerRegistry.h"
 #include "llvm/IR/DataLayout.h"
-#include "llvm/IR/ModuleSummaryIndex.h"
+#include "llvm/IR/FunctionInfo.h"
 #include "llvm/IR/IRPrintingPasses.h"
 #include "llvm/IR/LegacyPassManager.h"
 #include "llvm/IR/Module.h"
 #include "llvm/IR/Verifier.h"
 #include "llvm/MC/SubtargetFeature.h"
-#include "llvm/Object/ModuleSummaryIndexObjectFile.h"
+#include "llvm/Object/FunctionIndexObjectFile.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/PrettyStackTrace.h"
 #include "llvm/Support/TargetRegistry.h"
@@ -98,7 +98,7 @@ private:
     return PerFunctionPasses;
   }
 
-  void CreatePasses(ModuleSummaryIndex *ModuleSummary);
+  void CreatePasses(FunctionInfoIndex *FunctionIndex);
 
   /// Generates the TargetMachine.
   /// Returns Null if it is unable to create the target machine.
@@ -279,7 +279,7 @@ static void addSymbolRewriterPass(const
   MPM->add(createRewriteSymbolsPass(DL));
 }
 
-void EmitAssemblyHelper::CreatePasses(ModuleSummaryIndex *ModuleSummary) {
+void EmitAssemblyHelper::CreatePasses(FunctionInfoIndex *FunctionIndex) {
   if (CodeGenOpts.DisableLLVMPasses)
     return;
 
@@ -326,16 +326,16 @@ void EmitAssemblyHelper::CreatePasses(Mo
   PMBuilder.DisableUnitAtATime = !CodeGenOpts.UnitAtATime;
   PMBuilder.DisableUnrollLoops = !CodeGenOpts.UnrollLoops;
   PMBuilder.MergeFunctions = CodeGenOpts.MergeFunctions;
-  PMBuilder.PrepareForThinLTO = CodeGenOpts.EmitSummaryIndex;
+  PMBuilder.PrepareForThinLTO = CodeGenOpts.EmitFunctionSummary;
   PMBuilder.PrepareForLTO = CodeGenOpts.PrepareForLTO;
   PMBuilder.RerollLoops = CodeGenOpts.RerollLoops;
 
   legacy::PassManager *MPM = getPerModulePasses();
 
   // If we are performing a ThinLTO importing compile, invoke the LTO
-  // pipeline and pass down the in-memory module summary index.
-  if (ModuleSummary) {
-    PMBuilder.ModuleSummary = ModuleSummary;
+  // pipeline and pass down the in-memory function index.
+  if (FunctionIndex) {
+    PMBuilder.FunctionIndex = FunctionIndex;
     PMBuilder.populateThinLTOPassManager(*MPM);
     return;
   }
@@ -643,24 +643,24 @@ void EmitAssemblyHelper::EmitAssembly(Ba
   // If we are performing a ThinLTO importing compile, load the function
   // index into memory and pass it into CreatePasses, which will add it
   // to the PassManagerBuilder and invoke LTO passes.
-  std::unique_ptr<ModuleSummaryIndex> ModuleSummary;
+  std::unique_ptr<FunctionInfoIndex> FunctionIndex;
   if (!CodeGenOpts.ThinLTOIndexFile.empty()) {
-    ErrorOr<std::unique_ptr<ModuleSummaryIndex>> IndexOrErr =
-        llvm::getModuleSummaryIndexForFile(
-            CodeGenOpts.ThinLTOIndexFile, [&](const DiagnosticInfo &DI) {
-              TheModule->getContext().diagnose(DI);
-            });
+    ErrorOr<std::unique_ptr<FunctionInfoIndex>> IndexOrErr =
+        llvm::getFunctionIndexForFile(CodeGenOpts.ThinLTOIndexFile,
+                                      [&](const DiagnosticInfo &DI) {
+                                        TheModule->getContext().diagnose(DI);
+                                      });
     if (std::error_code EC = IndexOrErr.getError()) {
       std::string Error = EC.message();
       errs() << "Error loading index file '" << CodeGenOpts.ThinLTOIndexFile
              << "': " << Error << "\n";
       return;
     }
-    ModuleSummary = std::move(IndexOrErr.get());
-    assert(ModuleSummary && "Expected non-empty module summary index");
+    FunctionIndex = std::move(IndexOrErr.get());
+    assert(FunctionIndex && "Expected non-empty function index");
   }
 
-  CreatePasses(ModuleSummary.get());
+  CreatePasses(FunctionIndex.get());
 
   switch (Action) {
   case Backend_EmitNothing:
@@ -668,7 +668,7 @@ void EmitAssemblyHelper::EmitAssembly(Ba
 
   case Backend_EmitBC:
     getPerModulePasses()->add(createBitcodeWriterPass(
-        *OS, CodeGenOpts.EmitLLVMUseLists, CodeGenOpts.EmitSummaryIndex));
+        *OS, CodeGenOpts.EmitLLVMUseLists, CodeGenOpts.EmitFunctionSummary));
     break;
 
   case Backend_EmitLL:

Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=263494&r1=263493&r2=263494&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Mon Mar 14 16:18:17 2016
@@ -608,7 +608,7 @@ static bool ParseCodeGenArgs(CodeGenOpti
 
   Opts.PrepareForLTO = Args.hasArg(OPT_flto, OPT_flto_EQ);
   const Arg *A = Args.getLastArg(OPT_flto, OPT_flto_EQ);
-  Opts.EmitSummaryIndex = A && A->containsValue("thin");
+  Opts.EmitFunctionSummary = A && A->containsValue("thin");
   if (Arg *A = Args.getLastArg(OPT_fthinlto_index_EQ)) {
     if (IK != IK_LLVM_IR)
       Diags.Report(diag::err_drv_argument_only_allowed_with)




More information about the cfe-commits mailing list