[Support] Add MemoryBuffer::getFileSlice()
[oota-llvm.git] / include / llvm / Support / MemoryBuffer.h
index 341850a538d90aa3f3c523b63878ffaf281e9b87..e2f8d7e90fef275580defc80f5356a1db666453c 100644 (file)
@@ -126,6 +126,10 @@ public:
   static ErrorOr<std::unique_ptr<MemoryBuffer>>
   getFileOrSTDIN(const Twine &Filename, int64_t FileSize = -1);
 
+  /// Map a subrange of the the specified file as a MemoryBuffer.
+  static ErrorOr<std::unique_ptr<MemoryBuffer>>
+  getFileSlice(const Twine &Filename, uint64_t MapSize, uint64_t Offset);
+
   //===--------------------------------------------------------------------===//
   // Provided for performance analysis.
   //===--------------------------------------------------------------------===//