[PM] Rework the new PM support for building the ModuleSummaryIndex to
authorChandler Carruth <chandlerc@gmail.com>
Fri, 19 Aug 2016 07:49:19 +0000 (07:49 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Fri, 19 Aug 2016 07:49:19 +0000 (07:49 +0000)
commitb7be5b6479723482073ce88491422852e0c72ab7
treea32fb67015c19f88620a58587304c53d6ff4343e
parentddbab7d982347271c748336c0545599ce746ffae
[PM] Rework the new PM support for building the ModuleSummaryIndex to
directly produce the index as the value type result.

This requires making the index movable which is straightforward. It
greatly simplifies things by allowing us to completely avoid the builder
API and the layers of abstraction inherent there. Instead both pass
managers can directly construct these when run by value. They still
won't be constructed truly eagerly thanks to the optional in the legacy
PM. The code that directly builds the index can also just share a direct
function.

A notable change here is that the result type of the analysis for the
new PM is no longer a reference type. This was really problematic when
making changes to how we handle result types to make our interface
requirements *much* more strict and precise. But I think this is an
overall improvement.

Differential Revision: https://reviews.llvm.org/D23701

llvm-svn: 279216
llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h
llvm/include/llvm/IR/ModuleSummaryIndex.h
llvm/lib/Analysis/ModuleSummaryAnalysis.cpp
llvm/lib/LTO/ThinLTOCodeGenerator.cpp