Lines Matching defs:MemoryBuffer
1 //===--- MemoryBuffer.cpp - Memory Buffer implementation ------------------===//
10 // This file implements the MemoryBuffer interface.
14 #include "llvm/Support/MemoryBuffer.h"
42 // MemoryBuffer implementation itself.
45 MemoryBuffer::~MemoryBuffer() { }
47 /// init - Initialize this MemoryBuffer as a reference to externally allocated
49 void MemoryBuffer::init(const char *BufStart, const char *BufEnd,
68 /// GetNamedBuffer - Allocates a new MemoryBuffer with Name copied after it.
78 /// MemoryBufferMem - Named MemoryBuffer pointing to a block of memory.
79 class MemoryBufferMem : public MemoryBuffer {
96 /// getMemBuffer - Open the specified memory range as a MemoryBuffer. Note
98 MemoryBuffer *MemoryBuffer::getMemBuffer(StringRef InputData,
105 /// getMemBufferCopy - Open the specified memory range as a MemoryBuffer,
108 MemoryBuffer *MemoryBuffer::getMemBufferCopy(StringRef InputData,
110 MemoryBuffer *Buf = getNewUninitMemBuffer(InputData.size(), BufferName);
117 /// getNewUninitMemBuffer - Allocate a new MemoryBuffer of the specified size
119 /// memory allocated by this method. The memory is owned by the MemoryBuffer
121 MemoryBuffer *MemoryBuffer::getNewUninitMemBuffer(size_t Size,
123 // Allocate space for the MemoryBuffer, the data and the name. It is important
124 // that MemoryBuffer and data are aligned so PointerIntPair works with them.
142 /// getNewMemBuffer - Allocate a new MemoryBuffer of the specified size that
145 /// the MemoryBuffer object.
146 MemoryBuffer *MemoryBuffer::getNewMemBuffer(size_t Size, StringRef BufferName) {
147 MemoryBuffer *SB = getNewUninitMemBuffer(Size, BufferName);
154 /// getFileOrSTDIN - Open the specified file as a MemoryBuffer, or open stdin
158 error_code MemoryBuffer::getFileOrSTDIN(StringRef Filename,
159 OwningPtr<MemoryBuffer> &result,
166 error_code MemoryBuffer::getFileOrSTDIN(const char *Filename,
167 OwningPtr<MemoryBuffer> &result,
175 // MemoryBuffer::getFile implementation.
205 error_code MemoryBuffer::getFile(StringRef Filename,
206 OwningPtr<MemoryBuffer> &result,
211 return MemoryBuffer::getFile(PathBuf.c_str(), result, FileSize,
215 error_code MemoryBuffer::getFile(const char *Filename,
216 OwningPtr<MemoryBuffer> &result,
276 error_code MemoryBuffer::getOpenFile(int FD, const char *Filename,
277 OwningPtr<MemoryBuffer> &result,
313 MemoryBuffer *Buf = MemoryBuffer::getNewUninitMemBuffer(MapSize, Filename);
320 OwningPtr<MemoryBuffer> SB(Buf);
350 // MemoryBuffer::getSTDIN implementation.
353 error_code MemoryBuffer::getSTDIN(OwningPtr<MemoryBuffer> &result) {