summaryrefslogtreecommitdiff
path: root/lib/Bitcode
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@FreeBSD.org>2010-03-06 09:22:29 +0000
committerRoman Divacky <rdivacky@FreeBSD.org>2010-03-06 09:22:29 +0000
commitf5a3459adfde823bc7617f8ecfdd9fbc5a1ffadf (patch)
tree542734eaa7870f95912cbaebccb87dbec0c20b4f /lib/Bitcode
parent67a71b3184ce20a901e874d0ee25e01397dd87ef (diff)
Notes
Diffstat (limited to 'lib/Bitcode')
-rw-r--r--lib/Bitcode/Writer/BitWriter.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/Bitcode/Writer/BitWriter.cpp b/lib/Bitcode/Writer/BitWriter.cpp
index 7ed651b77e2e..428842246331 100644
--- a/lib/Bitcode/Writer/BitWriter.cpp
+++ b/lib/Bitcode/Writer/BitWriter.cpp
@@ -27,20 +27,14 @@ int LLVMWriteBitcodeToFile(LLVMModuleRef M, const char *Path) {
return 0;
}
-#if defined(__GNUC__) && (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR >= 4)
-#include <ext/stdio_filebuf.h>
-
-int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int FileHandle) {
- raw_fd_ostream OS(FileHandle, false);
+int LLVMWriteBitcodeToFD(LLVMModuleRef M, int FD, int ShouldClose,
+ int Unbuffered) {
+ raw_fd_ostream OS(FD, ShouldClose, Unbuffered);
WriteBitcodeToFile(unwrap(M), OS);
return 0;
}
-#else
-
int LLVMWriteBitcodeToFileHandle(LLVMModuleRef M, int FileHandle) {
- return -1; // Not supported.
+ return LLVMWriteBitcodeToFD(M, FileHandle, true, false);
}
-
-#endif