diff options
Diffstat (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index d0731eda73d..ed1b57124b6 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -61,8 +61,8 @@ static void findRefEdges(const User *CurUser, DenseSet<const Value *> &RefEdges, } } -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 @@ void ModuleSummaryIndexBuilder::computeFunctionInfo(const Function &F, 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 @@ void ModuleSummaryIndexBuilder::computeVariableInfo(const GlobalVariable &V) { 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 @@ ModuleSummaryIndexBuilder::ModuleSummaryIndexBuilder( 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 @@ ModuleSummaryIndexBuilder::ModuleSummaryIndexBuilder( for (const GlobalVariable &G : M->globals()) { if (G.isDeclaration()) continue; - computeVariableInfo(G); + computeVariableSummary(G); } } |

