Skip to content
Snippets Groups Projects
Commit 5666ad73 authored by Dan Gohman's avatar Dan Gohman
Browse files

Add a comment explaining a non-obvious API.

llvm-svn: 106539
parent 2ceaa71b
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment