[WebAssembly] Add a EM_WEBASSEMBLY value, and several bits of code that use it.
[oota-llvm.git] / include / llvm / Support / FileOutputBuffer.h
index 9f02a16e3d65928ab48ab21fe4bf8169dbe462b6..3bcf64a8a08bd59c6c8d88b729abc1ed38285045 100644 (file)
@@ -17,6 +17,7 @@
 #include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/DataTypes.h"
+#include "llvm/Support/ErrorOr.h"
 #include "llvm/Support/FileSystem.h"
 
 namespace llvm {
@@ -37,9 +38,8 @@ public:
   /// Factory method to create an OutputBuffer object which manages a read/write
   /// buffer of the specified size. When committed, the buffer will be written
   /// to the file at the specified path.
-  static std::error_code create(StringRef FilePath, size_t Size,
-                                std::unique_ptr<FileOutputBuffer> &Result,
-                                unsigned Flags = 0);
+  static ErrorOr<std::unique_ptr<FileOutputBuffer>>
+  create(StringRef FilePath, size_t Size, unsigned Flags = 0);
 
   /// Returns a pointer to the start of the buffer.
   uint8_t *getBufferStart() {
@@ -74,8 +74,8 @@ public:
   ~FileOutputBuffer();
 
 private:
-  FileOutputBuffer(const FileOutputBuffer &) LLVM_DELETED_FUNCTION;
-  FileOutputBuffer &operator=(const FileOutputBuffer &) LLVM_DELETED_FUNCTION;
+  FileOutputBuffer(const FileOutputBuffer &) = delete;
+  FileOutputBuffer &operator=(const FileOutputBuffer &) = delete;
 
   FileOutputBuffer(std::unique_ptr<llvm::sys::fs::mapped_file_region> R,
                    StringRef Path, StringRef TempPath);