summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitWriter.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-02-14 19:11:32 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-02-14 19:11:32 +0000
commit6a86e25d90303dd84f179cbe07db9c08eb8161eb (patch)
tree4ae81941bb37548c3242991b87afe00a87583d76 /llvm/lib/Bitcode/Writer/BitWriter.cpp
parent6d9cf8aa9d7cad2070f228ed00217ec3c5037d80 (diff)
downloadbcm5719-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/Bitcode/Writer/BitWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitWriter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitWriter.cpp b/llvm/lib/Bitcode/Writer/BitWriter.cpp
index e0388418a3d..763cd12aa2d 100644
--- a/llvm/lib/Bitcode/Writer/BitWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitWriter.cpp
@@ -25,7 +25,7 @@ int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) {
if (EC)
return -1;
- WriteBitcodeToFile(unwrap(M), OS);
+ WriteBitcodeToFile(*unwrap(M), OS);
return 0;
}
@@ -33,7 +33,7 @@ int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
int Unbuffered) {
raw_fd_ostream OS(FD, ShouldClose, Unbuffered);
- WriteBitcodeToFile(unwrap(M), OS);
+ WriteBitcodeToFile(*unwrap(M), OS);
return 0;
}
@@ -45,6 +45,6 @@ LLVMMemoryBufferRef LLVMWriteBitcodeToMemoryBuffer(LLVMModuleRef M) {
std::string Data;
raw_string_ostream OS(Data);
- WriteBitcodeToFile(unwrap(M), OS);
+ WriteBitcodeToFile(*unwrap(M), OS);
return wrap(MemoryBuffer::getMemBufferCopy(OS.str()).release());
}
OpenPOWER on IntegriCloud