summaryrefslogtreecommitdiff
path: root/utils/FileCheck
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2016-12-11 10:22:17 +0000
committerChandler Carruth <chandlerc@gmail.com>2016-12-11 10:22:17 +0000
commit9585dcb77ccf6b36873fe964c67dfec60f454bca (patch)
treee7fa96469dbdf18281d1f56e781207a070b08eba /utils/FileCheck
parentac7830ed772ae051129bd2cf34b231c02c7e3325 (diff)
[FileCheck] Remove a parameter that was simply always set to
a commandline flag and test the flag directly. NFC. If we ever need this generality it can be added back. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289381 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/FileCheck')
-rw-r--r--utils/FileCheck/FileCheck.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/utils/FileCheck/FileCheck.cpp b/utils/FileCheck/FileCheck.cpp
index 04cd7e869f0..4a20bd48f61 100644
--- a/utils/FileCheck/FileCheck.cpp
+++ b/utils/FileCheck/FileCheck.cpp
@@ -637,10 +637,7 @@ struct CheckString {
/// Canonicalize whitespaces in the file. Line endings are replaced with
/// UNIX-style '\n'.
-///
-/// \param PreserveHorizontal Don't squash consecutive horizontal whitespace
-/// characters to a single space.
-static StringRef CanonicalizeFile(MemoryBuffer &MB, bool PreserveHorizontal,
+static StringRef CanonicalizeFile(MemoryBuffer &MB,
SmallVectorImpl<char> &OutputBuffer) {
OutputBuffer.reserve(MB.getBufferSize());
@@ -653,7 +650,7 @@ static StringRef CanonicalizeFile(MemoryBuffer &MB, bool PreserveHorizontal,
// If current char is not a horizontal whitespace or if horizontal
// whitespace canonicalization is disabled, dump it to output as is.
- if (PreserveHorizontal || (*Ptr != ' ' && *Ptr != '\t')) {
+ if (NoCanonicalizeWhiteSpace || (*Ptr != ' ' && *Ptr != '\t')) {
OutputBuffer.push_back(*Ptr);
continue;
}
@@ -1360,8 +1357,7 @@ int main(int argc, char **argv) {
MemoryBuffer &CheckFile = *CheckFileOrErr.get();
SmallString<4096> CheckFileBuffer;
- StringRef CheckFileText =
- CanonicalizeFile(CheckFile, NoCanonicalizeWhiteSpace, CheckFileBuffer);
+ StringRef CheckFileText = CanonicalizeFile(CheckFile, CheckFileBuffer);
SM.AddNewSourceBuffer(MemoryBuffer::getMemBuffer(
CheckFileText, CheckFile.getBufferIdentifier()),
@@ -1388,8 +1384,7 @@ int main(int argc, char **argv) {
}
SmallString<4096> InputFileBuffer;
- StringRef InputFileText =
- CanonicalizeFile(InputFile, NoCanonicalizeWhiteSpace, InputFileBuffer);
+ StringRef InputFileText = CanonicalizeFile(InputFile, InputFileBuffer);
SM.AddNewSourceBuffer(MemoryBuffer::getMemBuffer(
InputFileText, InputFile.getBufferIdentifier()),