Add MemoryBuffer::getBuffer() -> StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79903 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-08-24 09:29:24 +00:00
parent 6aff2fbd56
commit 1464869cb3

View File

@ -14,6 +14,7 @@
#ifndef LLVM_SUPPORT_MEMORYBUFFER_H
#define LLVM_SUPPORT_MEMORYBUFFER_H
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DataTypes.h"
#include <string>
@ -42,6 +43,10 @@ public:
const char *getBufferEnd() const { return BufferEnd; }
size_t getBufferSize() const { return BufferEnd-BufferStart; }
StringRef getBuffer() const {
return StringRef(BufferStart, getBufferSize());
}
/// getBufferIdentifier - Return an identifier for this buffer, typically the
/// filename it was read from.
virtual const char *getBufferIdentifier() const {