mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2026-07-18 21:24:39 -04:00
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
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user