diff options
Diffstat (limited to 'include/llvm/Support/MemoryBuffer.h')
-rw-r--r-- | include/llvm/Support/MemoryBuffer.h | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index 6d6a5da180..8c742c686b 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -23,7 +23,6 @@ #include <system_error> namespace llvm { -using std::error_code; /// MemoryBuffer - This interface provides simple read-only access to a block /// of memory, and provides simple methods for reading files and standard input /// into a memory buffer. In addition to basic access to the characters in the @@ -69,11 +68,11 @@ public: /// \param IsVolatileSize Set to true to indicate that the file size may be /// changing, e.g. when libclang tries to parse while the user is /// editing/updating the file. - static error_code getFile(Twine Filename, - std::unique_ptr<MemoryBuffer> &Result, - int64_t FileSize = -1, - bool RequiresNullTerminator = true, - bool IsVolatileSize = false); + static std::error_code getFile(Twine Filename, + std::unique_ptr<MemoryBuffer> &Result, + int64_t FileSize = -1, + bool RequiresNullTerminator = true, + bool IsVolatileSize = false); /// Given an already-open file descriptor, map some slice of it into a /// MemoryBuffer. The slice is specified by an \p Offset and \p MapSize. @@ -82,10 +81,10 @@ public: /// \param IsVolatileSize Set to true to indicate that the file size may be /// changing, e.g. when libclang tries to parse while the user is /// editing/updating the file. - static error_code getOpenFileSlice(int FD, const char *Filename, - std::unique_ptr<MemoryBuffer> &Result, - uint64_t MapSize, int64_t Offset, - bool IsVolatileSize = false); + static std::error_code getOpenFileSlice(int FD, const char *Filename, + std::unique_ptr<MemoryBuffer> &Result, + uint64_t MapSize, int64_t Offset, + bool IsVolatileSize = false); /// Given an already-open file descriptor, read the file and return a /// MemoryBuffer. @@ -93,11 +92,11 @@ public: /// \param IsVolatileSize Set to true to indicate that the file size may be /// changing, e.g. when libclang tries to parse while the user is /// editing/updating the file. - static error_code getOpenFile(int FD, const char *Filename, - std::unique_ptr<MemoryBuffer> &Result, - uint64_t FileSize, - bool RequiresNullTerminator = true, - bool IsVolatileSize = false); + static std::error_code getOpenFile(int FD, const char *Filename, + std::unique_ptr<MemoryBuffer> &Result, + uint64_t FileSize, + bool RequiresNullTerminator = true, + bool IsVolatileSize = false); /// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note /// that InputData must be null terminated if RequiresNullTerminator is true. @@ -126,15 +125,14 @@ public: /// getSTDIN - Read all of stdin into a file buffer, and return it. /// If an error occurs, this returns null and sets ec. - static error_code getSTDIN(std::unique_ptr<MemoryBuffer> &Result); - + static std::error_code getSTDIN(std::unique_ptr<MemoryBuffer> &Result); /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin /// if the Filename is "-". If an error occurs, this returns null and sets /// ec. - static error_code getFileOrSTDIN(StringRef Filename, - std::unique_ptr<MemoryBuffer> &Result, - int64_t FileSize = -1); + static std::error_code getFileOrSTDIN(StringRef Filename, + std::unique_ptr<MemoryBuffer> &Result, + int64_t FileSize = -1); //===--------------------------------------------------------------------===// // Provided for performance analysis. |