OSDN Git Service

[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)
commitfefaef7b6ee02f56bc2496b5dea460b47058268d
tree92604a0d2eb676b65e20736f567f9d76dab9b9ec
parentedd69949b55423744541451cac763f751b6ee4c1
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279216 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Analysis/ModuleSummaryAnalysis.h
include/llvm/IR/ModuleSummaryIndex.h
lib/Analysis/ModuleSummaryAnalysis.cpp
lib/LTO/ThinLTOCodeGenerator.cpp