diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-01-28 20:46:26 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-01-28 20:46:26 +0000 |
commit | bf16554640037086bec7d6b7a179d8872a4acee9 (patch) | |
tree | 80110e69e031bd38f6441c2cfccde687a0d75cb0 /clang/lib/Basic/SourceLocation.cpp | |
parent | 3587d0b76230c87182ba99e52298fa247836bad6 (diff) | |
download | bcm5719-llvm-bf16554640037086bec7d6b7a179d8872a4acee9.tar.gz bcm5719-llvm-bf16554640037086bec7d6b7a179d8872a4acee9.zip |
Add method FullSourceLoc::getBufferData().
llvm-svn: 63229
Diffstat (limited to 'clang/lib/Basic/SourceLocation.cpp')
-rw-r--r-- | clang/lib/Basic/SourceLocation.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Basic/SourceLocation.cpp b/clang/lib/Basic/SourceLocation.cpp index 5d484721bd4..43fa3a13a6f 100644 --- a/clang/lib/Basic/SourceLocation.cpp +++ b/clang/lib/Basic/SourceLocation.cpp @@ -16,6 +16,8 @@ #include "clang/Basic/SourceManager.h" #include "llvm/Bitcode/Serialize.h" #include "llvm/Bitcode/Deserialize.h" +#include "llvm/Support/MemoryBuffer.h" + using namespace clang; void SourceLocation::Emit(llvm::Serializer& S) const { @@ -122,3 +124,7 @@ const llvm::MemoryBuffer* FullSourceLoc::getBuffer() const { return SrcMgr->getBuffer(SrcMgr->getFileID(*this)); } +std::pair<const char*, const char*> FullSourceLoc::getBufferData() const { + const llvm::MemoryBuffer *Buf = getBuffer(); + return std::make_pair(Buf->getBufferStart(), Buf->getBufferEnd()); +} |