[llvm] r289381 - [FileCheck] Remove a parameter that was simply always set to

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 11 02:22:17 PST 2016


Author: chandlerc
Date: Sun Dec 11 04:22:17 2016
New Revision: 289381

URL: http://llvm.org/viewvc/llvm-project?rev=289381&view=rev
Log:
[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.

Modified:
    llvm/trunk/utils/FileCheck/FileCheck.cpp

Modified: llvm/trunk/utils/FileCheck/FileCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/FileCheck/FileCheck.cpp?rev=289381&r1=289380&r2=289381&view=diff
==============================================================================
--- llvm/trunk/utils/FileCheck/FileCheck.cpp (original)
+++ llvm/trunk/utils/FileCheck/FileCheck.cpp Sun Dec 11 04:22:17 2016
@@ -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(Memory
 
     // 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()),




More information about the llvm-commits mailing list