aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-08-24 09:29:24 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-08-24 09:29:24 +0000
commit7c251a8f4665895e5d8b6f8ef9eb75f6b7b49e16 (patch)
tree294016b4b4d365ae9576caf9181f7156cd565aa2
parent30b0942913a10dd2da913ad66bd12fb08d46c32e (diff)
downloadexternal_llvm-7c251a8f4665895e5d8b6f8ef9eb75f6b7b49e16.zip
external_llvm-7c251a8f4665895e5d8b6f8ef9eb75f6b7b49e16.tar.gz
external_llvm-7c251a8f4665895e5d8b6f8ef9eb75f6b7b49e16.tar.bz2
Add MemoryBuffer::getBuffer() -> StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79903 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Support/MemoryBuffer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Support/MemoryBuffer.h b/include/llvm/Support/MemoryBuffer.h
index 58a217f..eb4784c 100644
--- a/include/llvm/Support/MemoryBuffer.h
+++ b/include/llvm/Support/MemoryBuffer.h
@@ -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 {