aboutsummaryrefslogtreecommitdiff
path: root/utils/FileCheck/FileCheck.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-05 22:42:30 +0000
committerChris Lattner <sabre@nondot.org>2010-04-05 22:42:30 +0000
commit4c842dda3939c6b9f83ba7e8e19e43445cd9a832 (patch)
treed3d4dd38475faa8e3bea9c995f993b662b688df9 /utils/FileCheck/FileCheck.cpp
parentda72249ecbfcaa6c8d81e9798812283b8a9947ed (diff)
stringref-ize the MemoryBuffer::get apis. This requires
a co-committed clang patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100485 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileCheck/FileCheck.cpp')
-rw-r--r--utils/FileCheck/FileCheck.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp
index c6a1392758..e7cd713ce6 100644
--- a/utils/FileCheck/FileCheck.cpp
+++ b/utils/FileCheck/FileCheck.cpp
@@ -441,7 +441,7 @@ struct CheckString {
/// CanonicalizeInputFile - Remove duplicate horizontal space from the specified
/// memory buffer, free it, and return a new one.
static MemoryBuffer *CanonicalizeInputFile(MemoryBuffer *MB) {
- SmallVector<char, 16> NewFile;
+ SmallString<128> NewFile;
NewFile.reserve(MB->getBufferSize());
for (const char *Ptr = MB->getBufferStart(), *End = MB->getBufferEnd();
@@ -461,9 +461,7 @@ static MemoryBuffer *CanonicalizeInputFile(MemoryBuffer *MB) {
// Free the old buffer and return a new one.
MemoryBuffer *MB2 =
- MemoryBuffer::getMemBufferCopy(NewFile.data(),
- NewFile.data() + NewFile.size(),
- MB->getBufferIdentifier());
+ MemoryBuffer::getMemBufferCopy(NewFile.str(), MB->getBufferIdentifier());
delete MB;
return MB2;