diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2018-02-14 19:11:32 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2018-02-14 19:11:32 +0000 |
| commit | 6a86e25d90303dd84f179cbe07db9c08eb8161eb (patch) | |
| tree | 4ae81941bb37548c3242991b87afe00a87583d76 /llvm/lib/Transforms | |
| parent | 6d9cf8aa9d7cad2070f228ed00217ec3c5037d80 (diff) | |
| download | bcm5719-llvm-6a86e25d90303dd84f179cbe07db9c08eb8161eb.tar.gz bcm5719-llvm-6a86e25d90303dd84f179cbe07db9c08eb8161eb.zip | |
Pass a reference to a module to the bitcode writer.
This simplifies most callers as they are already using references or
std::unique_ptr.
llvm-svn: 325155
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp index 7cc1e06964b..5c1f678b4d9 100644 --- a/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp +++ b/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp @@ -202,11 +202,11 @@ void splitAndWriteThinLTOBitcode( if (ModuleId.empty()) { // We couldn't generate a module ID for this module, just write it out as a // regular LTO module. - WriteBitcodeToFile(&M, OS); + WriteBitcodeToFile(M, OS); if (ThinLinkOS) // We don't have a ThinLTO part, but still write the module to the // ThinLinkOS if requested so that the expected output file is produced. - WriteBitcodeToFile(&M, *ThinLinkOS); + WriteBitcodeToFile(M, *ThinLinkOS); return; } @@ -374,10 +374,9 @@ void splitAndWriteThinLTOBitcode( // be used in the backends, and use that in the minimized bitcode // produced for the full link. ModuleHash ModHash = {{0}}; - W.writeModule(&M, /*ShouldPreserveUseListOrder=*/false, &Index, + W.writeModule(M, /*ShouldPreserveUseListOrder=*/false, &Index, /*GenerateHash=*/true, &ModHash); - W.writeModule(MergedM.get(), /*ShouldPreserveUseListOrder=*/false, - &MergedMIndex); + W.writeModule(*MergedM, /*ShouldPreserveUseListOrder=*/false, &MergedMIndex); W.writeSymtab(); W.writeStrtab(); OS << Buffer; @@ -389,8 +388,8 @@ void splitAndWriteThinLTOBitcode( Buffer.clear(); BitcodeWriter W2(Buffer); StripDebugInfo(M); - W2.writeThinLinkBitcode(&M, Index, ModHash); - W2.writeModule(MergedM.get(), /*ShouldPreserveUseListOrder=*/false, + W2.writeThinLinkBitcode(M, Index, ModHash); + W2.writeModule(*MergedM, /*ShouldPreserveUseListOrder=*/false, &MergedMIndex); W2.writeSymtab(); W2.writeStrtab(); @@ -423,13 +422,13 @@ void writeThinLTOBitcode(raw_ostream &OS, raw_ostream *ThinLinkOS, // be used in the backends, and use that in the minimized bitcode // produced for the full link. ModuleHash ModHash = {{0}}; - WriteBitcodeToFile(&M, OS, /*ShouldPreserveUseListOrder=*/false, Index, + WriteBitcodeToFile(M, OS, /*ShouldPreserveUseListOrder=*/false, Index, /*GenerateHash=*/true, &ModHash); // If a minimized bitcode module was requested for the thin link, only // the information that is needed by thin link will be written in the // given OS. if (ThinLinkOS && Index) - WriteThinLinkBitcodeToFile(&M, *ThinLinkOS, *Index, ModHash); + WriteThinLinkBitcodeToFile(M, *ThinLinkOS, *Index, ModHash); } class WriteThinLTOBitcode : public ModulePass { |

