projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a9cd41
)
Remove accidental include and add a comment.
author
Benjamin Kramer
<benny.kra@googlemail.com>
Thu, 1 Apr 2010 14:39:55 +0000
(14:39 +0000)
committer
Benjamin Kramer
<benny.kra@googlemail.com>
Thu, 1 Apr 2010 14:39:55 +0000
(14:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100107
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Support/MemoryBuffer.cpp
patch
|
blob
|
history
diff --git
a/lib/Support/MemoryBuffer.cpp
b/lib/Support/MemoryBuffer.cpp
index 9c84b30f91d980e66c71485b0dbc8ce59b823f0a..4f135ead182c106cf9a05228bb03f769e6736910 100644
(file)
--- a/
lib/Support/MemoryBuffer.cpp
+++ b/
lib/Support/MemoryBuffer.cpp
@@
-14,7
+14,6
@@
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/ADT/OwningPtr.h"
#include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/StringExtras.h"
#include "llvm/System/Errno.h"
#include "llvm/System/Path.h"
#include "llvm/System/Process.h"
@@
-242,8
+241,9
@@
MemoryBuffer *MemoryBuffer::getFile(StringRef Filename, std::string *ErrStr,
if (ErrStr) *ErrStr = sys::StrError();
return 0;
} else if (NumRead == 0) {
+ // We hit EOF early, truncate and terminate buffer.
Buf->BufferEnd = BufPtr;
- *BufPtr = 0;
// Null terminate buffer.
+ *BufPtr = 0;
return SB.take();
}
BytesLeft -= NumRead;