Move tool_output_file into its own file.
[oota-llvm.git] / tools / gold / gold-plugin.cpp
index 858af6f4324cfdcc2c0e269dcc10ec34e5cf74a6..0214c139349b88a3f90144fc6e9c602f8370e1e5 100644 (file)
@@ -17,7 +17,7 @@
 
 #include "llvm-c/lto.h"
 
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/ToolOutputFile.h"
 #include "llvm/System/Errno.h"
 #include "llvm/System/Path.h"
 #include "llvm/System/Program.h"
@@ -460,12 +460,12 @@ static ld_plugin_status all_symbols_read_hook(void) {
     return LDPS_ERR;
   }
 
-  objFile.write(buffer, bufsize);
-  objFile.close();
-  if (objFile.has_error()) {
+  objFile.os().write(buffer, bufsize);
+  objFile.os().close();
+  if (objFile.os().has_error()) {
     (*message)(LDPL_ERROR, "Error writing output file '%s'",
                uniqueObjPath.c_str());
-    objFile.clear_error();
+    objFile.os().clear_error();
     return LDPS_ERR;
   }
   objFile.keep();