diff options
author | Stephen Hines <srhines@google.com> | 2014-04-23 16:57:46 -0700 |
---|---|---|
committer | Stephen Hines <srhines@google.com> | 2014-04-24 15:53:16 -0700 |
commit | 36b56886974eae4f9c5ebc96befd3e7bfe5de338 (patch) | |
tree | e6cfb69fbbd937f450eeb83bfb83b9da3b01275a /include/llvm/Support/MemoryBuffer.h | |
parent | 69a8640022b04415ae9fac62f8ab090601d8f889 (diff) | |
download | external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.gz external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.tar.bz2 external_llvm-36b56886974eae4f9c5ebc96befd3e7bfe5de338.zip |
Update to LLVM 3.5a.
Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
Diffstat (limited to 'include/llvm/Support/MemoryBuffer.h')
-rw-r--r-- | include/llvm/Support/MemoryBuffer.h | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h index ff22fb67c8..578c7e8eb8 100644 --- a/include/llvm/Support/MemoryBuffer.h +++ b/include/llvm/Support/MemoryBuffer.h @@ -14,11 +14,12 @@ #ifndef LLVM_SUPPORT_MEMORYBUFFER_H #define LLVM_SUPPORT_MEMORYBUFFER_H +#include "llvm-c/Support.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/CBindingWrapping.h" #include "llvm/Support/Compiler.h" #include "llvm/Support/DataTypes.h" -#include "llvm-c/Core.h" +#include <memory> namespace llvm { @@ -66,7 +67,11 @@ public: /// MemoryBuffer if successful, otherwise returning null. If FileSize is /// specified, this means that the client knows that the file exists and that /// it has the specified size. - static error_code getFile(Twine Filename, OwningPtr<MemoryBuffer> &result, + static error_code getFile(Twine Filename, OwningPtr<MemoryBuffer> &Result, + int64_t FileSize = -1, + bool RequiresNullTerminator = true); + static error_code getFile(Twine Filename, + std::unique_ptr<MemoryBuffer> &Result, int64_t FileSize = -1, bool RequiresNullTerminator = true); @@ -76,6 +81,9 @@ public: static error_code getOpenFileSlice(int FD, const char *Filename, OwningPtr<MemoryBuffer> &Result, uint64_t MapSize, int64_t Offset); + static error_code getOpenFileSlice(int FD, const char *Filename, + std::unique_ptr<MemoryBuffer> &Result, + uint64_t MapSize, int64_t Offset); /// Given an already-open file descriptor, read the file and return a /// MemoryBuffer. @@ -83,6 +91,10 @@ public: OwningPtr<MemoryBuffer> &Result, uint64_t FileSize, bool RequiresNullTerminator = true); + static error_code getOpenFile(int FD, const char *Filename, + std::unique_ptr<MemoryBuffer> &Result, + uint64_t FileSize, + bool RequiresNullTerminator = true); /// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note /// that InputData must be null terminated if RequiresNullTerminator is true. @@ -111,14 +123,18 @@ 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(OwningPtr<MemoryBuffer> &result); + static error_code getSTDIN(OwningPtr<MemoryBuffer> &Result); + static 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, - OwningPtr<MemoryBuffer> &result, + OwningPtr<MemoryBuffer> &Result, + int64_t FileSize = -1); + static error_code getFileOrSTDIN(StringRef Filename, + std::unique_ptr<MemoryBuffer> &Result, int64_t FileSize = -1); //===--------------------------------------------------------------------===// |