Fix an ENABLE_EXPENSIVE_CHECKS error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77845 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Daniel Dunbar 2009-08-02 01:21:22 +00:00
parent 18f54c07e1
commit 6f69aa3561

View File

@ -153,7 +153,7 @@ static void CanonicalizeCheckStrings(std::vector<std::pair<std::string, SMLoc> >
/// CanonicalizeInputFile - Remove duplicate horizontal space from the specified
/// memory buffer, free it, and return a new one.
static MemoryBuffer *CanonicalizeInputFile(MemoryBuffer *MB) {
std::vector<char> NewFile;
SmallVector<char, 16> NewFile;
NewFile.reserve(MB->getBufferSize());
for (const char *Ptr = MB->getBufferStart(), *End = MB->getBufferEnd();
@ -173,7 +173,8 @@ static MemoryBuffer *CanonicalizeInputFile(MemoryBuffer *MB) {
// Free the old buffer and return a new one.
MemoryBuffer *MB2 =
MemoryBuffer::getMemBufferCopy(&NewFile[0], &NewFile[0]+NewFile.size(),
MemoryBuffer::getMemBufferCopy(NewFile.data(),
NewFile.data() + NewFile.size(),
MB->getBufferIdentifier());
delete MB;