From 01095a5d43bbfde13731688ddcf6048ebb8b7721 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sat, 23 Jul 2016 20:41:05 +0000 Subject: Vendor import of llvm release_39 branch r276489: https://llvm.org/svn/llvm-project/llvm/branches/release_39@276489 --- include/llvm/Bitcode/BitcodeWriterPass.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'include/llvm/Bitcode/BitcodeWriterPass.h') diff --git a/include/llvm/Bitcode/BitcodeWriterPass.h b/include/llvm/Bitcode/BitcodeWriterPass.h index a1272cf156e5..946255b878a6 100644 --- a/include/llvm/Bitcode/BitcodeWriterPass.h +++ b/include/llvm/Bitcode/BitcodeWriterPass.h @@ -16,12 +16,12 @@ #define LLVM_BITCODE_BITCODEWRITERPASS_H #include "llvm/ADT/StringRef.h" +#include "llvm/IR/PassManager.h" namespace llvm { class Module; class ModulePass; class raw_ostream; -class PreservedAnalyses; /// \brief Create and return a pass that writes the module to the specified /// ostream. Note that this pass is designed for use with the legacy pass @@ -30,11 +30,15 @@ class PreservedAnalyses; /// If \c ShouldPreserveUseListOrder, encode use-list order so it can be /// reproduced when deserialized. /// -/// If \c EmitFunctionSummary, emit the function summary index (currently -/// for use in ThinLTO optimization). +/// If \c EmitSummaryIndex, emit the summary index (currently for use in ThinLTO +/// optimization). +/// +/// If \c EmitModuleHash, compute and emit the module hash in the bitcode +/// (currently for use in ThinLTO incremental build). ModulePass *createBitcodeWriterPass(raw_ostream &Str, bool ShouldPreserveUseListOrder = false, - bool EmitFunctionSummary = false); + bool EmitSummaryIndex = false, + bool EmitModuleHash = false); /// \brief Pass for writing a module of IR out to a bitcode file. /// @@ -43,7 +47,8 @@ ModulePass *createBitcodeWriterPass(raw_ostream &Str, class BitcodeWriterPass { raw_ostream &OS; bool ShouldPreserveUseListOrder; - bool EmitFunctionSummary; + bool EmitSummaryIndex; + bool EmitModuleHash; public: /// \brief Construct a bitcode writer pass around a particular output stream. @@ -51,17 +56,18 @@ public: /// If \c ShouldPreserveUseListOrder, encode use-list order so it can be /// reproduced when deserialized. /// - /// If \c EmitFunctionSummary, emit the function summary index (currently + /// If \c EmitSummaryIndex, emit the summary index (currently /// for use in ThinLTO optimization). explicit BitcodeWriterPass(raw_ostream &OS, bool ShouldPreserveUseListOrder = false, - bool EmitFunctionSummary = false) + bool EmitSummaryIndex = false, + bool EmitModuleHash = false) : OS(OS), ShouldPreserveUseListOrder(ShouldPreserveUseListOrder), - EmitFunctionSummary(EmitFunctionSummary) {} + EmitSummaryIndex(EmitSummaryIndex), EmitModuleHash(EmitModuleHash) {} /// \brief Run the bitcode writer pass, and output the module to the selected /// output stream. - PreservedAnalyses run(Module &M); + PreservedAnalyses run(Module &M, ModuleAnalysisManager &); static StringRef name() { return "BitcodeWriterPass"; } }; -- cgit v1.3