diff options
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp index 3e89ade..e8e0b10 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp @@ -19,12 +19,11 @@ #include "llvm/Pass.h" using namespace llvm; -PreservedAnalyses BitcodeWriterPass::run(Module &M, ModuleAnalysisManager &) { - std::unique_ptr<ModuleSummaryIndex> Index; - if (EmitSummaryIndex) - Index = ModuleSummaryIndexBuilder(&M).takeIndex(); - WriteBitcodeToFile(&M, OS, ShouldPreserveUseListOrder, Index.get(), - EmitModuleHash); +PreservedAnalyses BitcodeWriterPass::run(Module &M, ModuleAnalysisManager &AM) { + const ModuleSummaryIndex *Index = + EmitSummaryIndex ? &(AM.getResult<ModuleSummaryIndexAnalysis>(M)) + : nullptr; + WriteBitcodeToFile(&M, OS, ShouldPreserveUseListOrder, Index, EmitModuleHash); return PreservedAnalyses::all(); } |