X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FSupport%2FFileOutputBuffer.h;h=fd8879c84622f111e86d8cfa052d7bb5ddc9eee6;hb=5651a7bd67d465ea5c10c3f0a949c442bef36106;hp=1884a242b3eb4edf304a2bca028e1bb4b3fb1ace;hpb=fbf6daaec64cced33b5b4e944ef4804ad79d76c2;p=oota-llvm.git diff --git a/include/llvm/Support/FileOutputBuffer.h b/include/llvm/Support/FileOutputBuffer.h index 1884a242b3e..fd8879c8462 100644 --- a/include/llvm/Support/FileOutputBuffer.h +++ b/include/llvm/Support/FileOutputBuffer.h @@ -14,15 +14,12 @@ #ifndef LLVM_SUPPORT_FILEOUTPUTBUFFER_H #define LLVM_SUPPORT_FILEOUTPUTBUFFER_H -#include "llvm/ADT/OwningPtr.h" #include "llvm/ADT/SmallString.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/DataTypes.h" #include "llvm/Support/FileSystem.h" namespace llvm { -class error_code; - /// FileOutputBuffer - This interface provides simple way to create an in-memory /// buffer which will be written to a file. During the lifetime of these /// objects, the content or existence of the specified file is undefined. That @@ -40,12 +37,9 @@ 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 error_code create(StringRef FilePath, size_t Size, - OwningPtr &Result, - unsigned Flags = 0); - static error_code create(StringRef FilePath, size_t Size, - std::unique_ptr &Result, - unsigned Flags = 0); + static std::error_code create(StringRef FilePath, size_t Size, + std::unique_ptr &Result, + unsigned Flags = 0); /// Returns a pointer to the start of the buffer. uint8_t *getBufferStart() { @@ -72,7 +66,7 @@ public: /// is called, the file is deleted in the destructor. The optional parameter /// is used if it turns out you want the file size to be smaller than /// initially requested. - error_code commit(int64_t NewSmallerSize = -1); + std::error_code commit(); /// If this object was previously committed, the destructor just deletes /// this object. If this object was not committed, the destructor @@ -80,10 +74,10 @@ 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(llvm::sys::fs::mapped_file_region *R, + FileOutputBuffer(std::unique_ptr R, StringRef Path, StringRef TempPath); std::unique_ptr Region;