summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Writer/BitWriter.cpp
diff options
context:
space:
mode:
authorErick Tryzelaar <idadesub@users.sourceforge.net>2010-03-06 00:30:06 +0000
committerErick Tryzelaar <idadesub@users.sourceforge.net>2010-03-06 00:30:06 +0000
commit381268e629041da9add8736ddbfe87b7bb420f38 (patch)
treed375bbed34449f4f19d3ef8d67a2fffb64830420 /llvm/lib/Bitcode/Writer/BitWriter.cpp
parentdc78d16a03bfbab573da26915995c18f172c3555 (diff)
downloadbcm5719-llvm-381268e629041da9add8736ddbfe87b7bb420f38.tar.gz
bcm5719-llvm-381268e629041da9add8736ddbfe87b7bb420f38.zip
Add a LLVMWriteBitcodeToFD that exposes the raw_fd_ostream options.
llvm-svn: 97858
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitWriter.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitWriter.cpp b/llvm/lib/Bitcode/Writer/BitWriter.cpp
index 6119c428895..42884224633 100644
--- a/llvm/lib/Bitcode/Writer/BitWriter.cpp
+++ b/llvm/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);
+}
OpenPOWER on IntegriCloud