From e623050048e56a512e77c28b69925e7dc1efa6ad Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Sat, 6 Mar 2010 00:30:06 +0000 Subject: Add a LLVMWriteBitcodeToFD that exposes the raw_fd_ostream options. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97858 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Bitcode/Writer/BitWriter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/Bitcode') diff --git a/lib/Bitcode/Writer/BitWriter.cpp b/lib/Bitcode/Writer/BitWriter.cpp index 6119c42..4288422 100644 --- a/lib/Bitcode/Writer/BitWriter.cpp +++ b/lib/Bitcode/Writer/BitWriter.cpp @@ -27,9 +27,14 @@ int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) { return 0; } -int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int FileHandle) { - raw_fd_ostream OS(FileHandle, true); +int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose, + int Unbuffered) { + raw_fd_ostream OS(FD, ShouldClose, Unbuffered); WriteBitcodeToFile(unwrap(M), OS); return 0; } + +int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int FileHandle) { + return LLVMWriteBitcodeToFD(M, FileHandle, true, false); +} -- cgit v1.1