summaryrefslogtreecommitdiff
path: root/include/llvm/Bitcode/BitcodeWriterPass.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-07-23 20:41:05 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-07-23 20:41:05 +0000
commit01095a5d43bbfde13731688ddcf6048ebb8b7721 (patch)
tree4def12e759965de927d963ac65840d663ef9d1ea /include/llvm/Bitcode/BitcodeWriterPass.h
parentf0f4822ed4b66e3579e92a89f368f8fb860e218e (diff)
Notes
Diffstat (limited to 'include/llvm/Bitcode/BitcodeWriterPass.h')
-rw-r--r--include/llvm/Bitcode/BitcodeWriterPass.h24
1 files changed, 15 insertions, 9 deletions
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"; }
};