diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-10 21:07:19 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-04-10 21:07:19 +0000 |
commit | f9e4576e080501459e22e75775e6b931a8e7fd85 (patch) | |
tree | c3d316809724f8a5357ed9bf520c4a600b721fdc /llvm/lib | |
parent | 369bced2b1da15a7ef699f28311f100fa115be3f (diff) | |
download | bcm5719-llvm-f9e4576e080501459e22e75775e6b931a8e7fd85.tar.gz bcm5719-llvm-f9e4576e080501459e22e75775e6b931a8e7fd85.zip |
Plumb the option to emit the `ModuleHash` in the bitcode through the bitcode writer APIs
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 265907
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp index 85b9bd83c13..7dbede4a847 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp @@ -19,7 +19,7 @@ using namespace llvm; PreservedAnalyses BitcodeWriterPass::run(Module &M) { - WriteBitcodeToFile(&M, OS, ShouldPreserveUseListOrder, EmitSummaryIndex); + WriteBitcodeToFile(&M, OS, ShouldPreserveUseListOrder, EmitSummaryIndex, EmitModuleHash); return PreservedAnalyses::all(); } @@ -28,19 +28,20 @@ namespace { raw_ostream &OS; // raw_ostream to print on bool ShouldPreserveUseListOrder; bool EmitSummaryIndex; + bool EmitModuleHash; public: static char ID; // Pass identification, replacement for typeid explicit WriteBitcodePass(raw_ostream &o, bool ShouldPreserveUseListOrder, - bool EmitSummaryIndex) + bool EmitSummaryIndex, bool EmitModuleHash) : ModulePass(ID), OS(o), ShouldPreserveUseListOrder(ShouldPreserveUseListOrder), - EmitSummaryIndex(EmitSummaryIndex) {} + EmitSummaryIndex(EmitSummaryIndex), EmitModuleHash(EmitModuleHash) {} const char *getPassName() const override { return "Bitcode Writer"; } bool runOnModule(Module &M) override { - WriteBitcodeToFile(&M, OS, ShouldPreserveUseListOrder, EmitSummaryIndex); + WriteBitcodeToFile(&M, OS, ShouldPreserveUseListOrder, EmitSummaryIndex, EmitModuleHash); return false; } }; @@ -50,7 +51,7 @@ char WriteBitcodePass::ID = 0; ModulePass *llvm::createBitcodeWriterPass(raw_ostream &Str, bool ShouldPreserveUseListOrder, - bool EmitSummaryIndex) { + bool EmitSummaryIndex, bool EmitModuleHash) { return new WriteBitcodePass(Str, ShouldPreserveUseListOrder, - EmitSummaryIndex); + EmitSummaryIndex, EmitModuleHash); } |