diff options
author | Dan Gohman <gohman@apple.com> | 2010-06-22 13:57:08 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-06-22 13:57:08 +0000 |
commit | 5666ad73813d05af45af85b165965d6da3c792e6 (patch) | |
tree | c73d5abaabfe3ac041130d013f934b5e252c444f /llvm | |
parent | 2ceaa71bdb4ad88c6f34ca840f6aedf8f5259168 (diff) | |
download | bcm5719-llvm-5666ad73813d05af45af85b165965d6da3c792e6.tar.gz bcm5719-llvm-5666ad73813d05af45af85b165965d6da3c792e6.zip |
Add a comment explaining a non-obvious API.
llvm-svn: 106539
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Support/MemoryBuffer.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/MemoryBuffer.h b/llvm/include/llvm/Support/MemoryBuffer.h index 38f61935d97..0b6cd12f6f4 100644 --- a/llvm/include/llvm/Support/MemoryBuffer.h +++ b/llvm/include/llvm/Support/MemoryBuffer.h @@ -26,6 +26,11 @@ namespace llvm { /// into a memory buffer. In addition to basic access to the characters in the /// file, this interface guarantees you can read one character past the end of /// the file, and that this character will read as '\0'. +/// +/// The '\0' guarantee is needed to support an optimization -- it's intended to +/// be more efficient for clients which are reading all the data to stop +/// reading when they encounter a '\0' than to continually check the file +/// position to see if it has reached the end of the file. class MemoryBuffer { const char *BufferStart; // Start of the buffer. const char *BufferEnd; // End of the buffer. |