diff options
author | Chris Lattner <sabre@nondot.org> | 2009-03-18 20:36:45 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-03-18 20:36:45 +0000 |
commit | 0f6dc78cfeed7ce60b6309e7401d2d77170ae717 (patch) | |
tree | 4b2292cd2ba9d547e74a5a8805e47d0075b5ee0b /llvm/utils/TableGen/TGSourceMgr.cpp | |
parent | 5def81401f499ddecb97243a008cc56f52674ac8 (diff) | |
download | bcm5719-llvm-0f6dc78cfeed7ce60b6309e7401d2d77170ae717.tar.gz bcm5719-llvm-0f6dc78cfeed7ce60b6309e7401d2d77170ae717.zip |
include the null at the end of a memorybuffer as part of the buffer.
This allows tblgen to handle include "foo.td" when the quote is exactly
the last character in a file. rdar://6695728
llvm-svn: 67232
Diffstat (limited to 'llvm/utils/TableGen/TGSourceMgr.cpp')
-rw-r--r-- | llvm/utils/TableGen/TGSourceMgr.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/utils/TableGen/TGSourceMgr.cpp b/llvm/utils/TableGen/TGSourceMgr.cpp index 9c39230def2..e4d1c40dc6c 100644 --- a/llvm/utils/TableGen/TGSourceMgr.cpp +++ b/llvm/utils/TableGen/TGSourceMgr.cpp @@ -28,7 +28,9 @@ TGSourceMgr::~TGSourceMgr() { int TGSourceMgr::FindBufferContainingLoc(TGLoc Loc) const { for (unsigned i = 0, e = Buffers.size(); i != e; ++i) if (Loc.getPointer() >= Buffers[i].Buffer->getBufferStart() && - Loc.getPointer() < Buffers[i].Buffer->getBufferEnd()) + // Use <= here so that a pointer to the null at the end of the buffer + // is included as part of the buffer. + Loc.getPointer() <= Buffers[i].Buffer->getBufferEnd()) return i; return -1; } |