[ThinLTO] Remove GlobalValueInfo class from index

Summary:
Remove the GlobalValueInfo and change the ModuleSummaryIndex to directly
reference summary objects. The info structure was there to support lazy
parsing of the combined index summary objects, which is no longer
needed and not supported.

Reviewers: joker.eph

Subscribers: joker.eph, llvm-commits

Differential Revision: http://reviews.llvm.org/D19462

llvm-svn: 267344
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
index d0731ed..ed1b571 100644
--- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
+++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
@@ -61,8 +61,8 @@
   }
 }
 
-void ModuleSummaryIndexBuilder::computeFunctionInfo(const Function &F,
-                                                    BlockFrequencyInfo *BFI) {
+void ModuleSummaryIndexBuilder::computeFunctionSummary(
+    const Function &F, BlockFrequencyInfo *BFI) {
   // Summary not currently supported for anonymous functions, they must
   // be renamed.
   if (!F.hasName())
@@ -100,12 +100,11 @@
       llvm::make_unique<FunctionSummary>(Flags, NumInsts);
   FuncSummary->addCallGraphEdges(CallGraphEdges);
   FuncSummary->addRefEdges(RefEdges);
-  std::unique_ptr<GlobalValueInfo> GVInfo =
-      llvm::make_unique<GlobalValueInfo>(0, std::move(FuncSummary));
-  Index->addGlobalValueInfo(F.getName(), std::move(GVInfo));
+  Index->addGlobalValueSummary(F.getName(), std::move(FuncSummary));
 }
 
-void ModuleSummaryIndexBuilder::computeVariableInfo(const GlobalVariable &V) {
+void ModuleSummaryIndexBuilder::computeVariableSummary(
+    const GlobalVariable &V) {
   DenseSet<const Value *> RefEdges;
   SmallPtrSet<const User *, 8> Visited;
   findRefEdges(&V, RefEdges, Visited);
@@ -113,9 +112,7 @@
   std::unique_ptr<GlobalVarSummary> GVarSummary =
       llvm::make_unique<GlobalVarSummary>(Flags);
   GVarSummary->addRefEdges(RefEdges);
-  std::unique_ptr<GlobalValueInfo> GVInfo =
-      llvm::make_unique<GlobalValueInfo>(0, std::move(GVarSummary));
-  Index->addGlobalValueInfo(V.getName(), std::move(GVInfo));
+  Index->addGlobalValueSummary(V.getName(), std::move(GVarSummary));
 }
 
 ModuleSummaryIndexBuilder::ModuleSummaryIndexBuilder(
@@ -164,7 +161,7 @@
       BFI = BFIPtr.get();
     }
 
-    computeFunctionInfo(F, BFI);
+    computeFunctionSummary(F, BFI);
   }
 
   // Compute summaries for all variables defined in module, and save in the
@@ -172,7 +169,7 @@
   for (const GlobalVariable &G : M->globals()) {
     if (G.isDeclaration())
       continue;
-    computeVariableInfo(G);
+    computeVariableSummary(G);
   }
 }